File tree 4 files changed +45
-0
lines changed 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,16 @@ func SignUp(ctx *context.Context) {
393
393
394
394
ctx .Data ["SignUpLink" ] = setting .AppSubURL + "/user/sign_up"
395
395
396
+ orderedOAuth2Names , oauth2Providers , err := oauth2 .GetActiveOAuth2Providers ()
397
+ if err != nil {
398
+ ctx .ServerError ("UserSignUp" , err )
399
+ return
400
+ }
401
+
402
+ ctx .Data ["OrderedOAuth2Names" ] = orderedOAuth2Names
403
+ ctx .Data ["OAuth2Providers" ] = oauth2Providers
396
404
context .SetCaptchaData (ctx )
405
+
397
406
ctx .Data ["PageIsSignUp" ] = true
398
407
399
408
// Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -409,7 +418,16 @@ func SignUpPost(ctx *context.Context) {
409
418
410
419
ctx .Data ["SignUpLink" ] = setting .AppSubURL + "/user/sign_up"
411
420
421
+ orderedOAuth2Names , oauth2Providers , err := oauth2 .GetActiveOAuth2Providers ()
422
+ if err != nil {
423
+ ctx .ServerError ("UserSignUp" , err )
424
+ return
425
+ }
426
+
427
+ ctx .Data ["OrderedOAuth2Names" ] = orderedOAuth2Names
428
+ ctx .Data ["OAuth2Providers" ] = oauth2Providers
412
429
context .SetCaptchaData (ctx )
430
+
413
431
ctx .Data ["PageIsSignUp" ] = true
414
432
415
433
// Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
Original file line number Diff line number Diff line change 4
4
<a class="{{if .PageIsLogin}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login">
5
5
{{.locale.Tr "auth.login_userpass"}}
6
6
</a>
7
+ <a class="{{if .PageIsSignUp}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/sign_up">
8
+ {{.locale.Tr "auth.create_new_account"}}
9
+ </a>
7
10
{{if .EnableOpenIDSignIn}}
8
11
<a class="{{if .PageIsLoginOpenID}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login/openid">
9
12
{{svg "fontawesome-openid"}}
Original file line number Diff line number Diff line change 1
1
{{template "base/head" .}}
2
2
<div role="main" aria-label="{{.Title}}" class="page-content user signin{{if .LinkAccountMode}} icon{{end}}">
3
+ {{template "user/auth/signin_navbar" .}}
3
4
<div class="ui middle very relaxed page grid">
4
5
{{template "user/auth/signup_inner" .}}
5
6
</div>
Original file line number Diff line number Diff line change 55
55
</div>
56
56
{{end}}
57
57
{{end}}
58
+
59
+ {{if and .OrderedOAuth2Names .OAuth2Providers}}
60
+ <div class="ui attached segment">
61
+ <div class="oauth2 center">
62
+ <div id="oauth2-login-loader" class="ui disabled centered loader"></div>
63
+ <div>
64
+ <div id="oauth2-login-navigator">
65
+ <p>{{.i18n.Tr "sign_in_with"}}</p>
66
+ {{range $key := .OrderedOAuth2Names}}
67
+ {{$provider := index $.OAuth2Providers $key}}
68
+ <a href="{{AppSubUrl}}/user/oauth2/{{$key}}">
69
+ <img
70
+ alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
71
+ title="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
72
+ class="{{$provider.Name}} oauth-login-image"
73
+ src="{{AppSubUrl}}{{$provider.Image}}"
74
+ ></a>
75
+ {{end}}
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ {{end}}
58
81
</form>
59
82
</div>
60
83
</div>
You can’t perform that action at this time.
0 commit comments