aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/auth
diff options
context:
space:
mode:
authorDmitry Sharshakov <d3dx12.xx@gmail.com>2023-09-13 08:14:21 +0300
committerGitHub <noreply@github.com>2023-09-13 05:14:21 +0000
commit63b53af933d748f9b4e0f1273e3701b4c3d08ac3 (patch)
treebfb8a2b0b642fb065783e7b721dcb2c2a4c7d92f /routers/web/auth
parentcda97a725347cdadd43af812749732b9d1ee6429 (diff)
downloadgitea-63b53af933d748f9b4e0f1273e3701b4c3d08ac3.tar.gz
gitea-63b53af933d748f9b4e0f1273e3701b4c3d08ac3.zip
Show OpenID Connect and OAuth on signup page (#20242)
Fix #19809 --------- Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com> Co-authored-by: jackHay22 <jack@allspice.io>
Diffstat (limited to 'routers/web/auth')
-rw-r--r--routers/web/auth/auth.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go
index c20a45ebc9..dac8eb7afb 100644
--- a/routers/web/auth/auth.go
+++ b/routers/web/auth/auth.go
@@ -392,7 +392,16 @@ func SignUp(ctx *context.Context) {
ctx.Data["SignUpLink"] = setting.AppSubURL + "/user/sign_up"
+ orderedOAuth2Names, oauth2Providers, err := oauth2.GetActiveOAuth2Providers()
+ if err != nil {
+ ctx.ServerError("UserSignUp", err)
+ return
+ }
+
+ ctx.Data["OrderedOAuth2Names"] = orderedOAuth2Names
+ ctx.Data["OAuth2Providers"] = oauth2Providers
context.SetCaptchaData(ctx)
+
ctx.Data["PageIsSignUp"] = true
// Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -413,7 +422,16 @@ func SignUpPost(ctx *context.Context) {
ctx.Data["SignUpLink"] = setting.AppSubURL + "/user/sign_up"
+ orderedOAuth2Names, oauth2Providers, err := oauth2.GetActiveOAuth2Providers()
+ if err != nil {
+ ctx.ServerError("UserSignUp", err)
+ return
+ }
+
+ ctx.Data["OrderedOAuth2Names"] = orderedOAuth2Names
+ ctx.Data["OAuth2Providers"] = oauth2Providers
context.SetCaptchaData(ctx)
+
ctx.Data["PageIsSignUp"] = true
// Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true