diff --git a/internal/web/auth.go b/internal/web/auth.go index 3e54f33..1e21a6a 100644 --- a/internal/web/auth.go +++ b/internal/web/auth.go @@ -163,7 +163,7 @@ func oauthCallback(ctx echo.Context) error { if err = userDB.Create(); err != nil { if models.IsUniqueConstraintViolation(err) { - addFlash(ctx, "Username "+user.NickName+" already exists in opengist", "error") + addFlash(ctx, "Username "+user.NickName+" already exists in Opengist", "error") return redirect(ctx, "/login") } diff --git a/internal/web/run.go b/internal/web/run.go index c014a8a..efaf095 100644 --- a/internal/web/run.go +++ b/internal/web/run.go @@ -249,6 +249,9 @@ func dataInit(next echo.HandlerFunc) echo.HandlerFunc { } setData(ctx, "signupDisabled", disableSignup == "1") + setData(ctx, "githubOauth", config.C.GithubClientKey != "" && config.C.GithubSecret != "") + setData(ctx, "giteaOauth", config.C.GiteaClientKey != "" && config.C.GiteaSecret != "") + return next(ctx) } } diff --git a/templates/pages/auth_form.html b/templates/pages/auth_form.html index 9d05793..0abae36 100644 --- a/templates/pages/auth_form.html +++ b/templates/pages/auth_form.html @@ -48,6 +48,25 @@ {{ end }} {{ .csrfHtml }} + +