Skip to content

Commit 171edfc

Browse files
authored
Fix oauth2 login methods (#32698)
Regression of #32687 It should use "or" but not "and", otherwise the oauth2 methods won't show when no ENABLE_OPENID_SIGNIN
1 parent 690d074 commit 171edfc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

templates/user/auth/signin_inner.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@
4848
</div>
4949
</form>
5050
{{end}}{{/*if .EnablePasswordSignInForm*/}}
51-
{{if and .OAuth2Providers .EnableOpenIDSignIn .EnablePasswordSignInForm}}
51+
{{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}}
52+
{{if and $showOAuth2Methods .EnablePasswordSignInForm}}
5253
<div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
5354
{{end}}
54-
{{if and .OAuth2Providers .EnableOpenIDSignIn}}
55+
{{if $showOAuth2Methods}}
5556
{{template "user/auth/oauth_container" .}}
5657
{{end}}
5758
</div>

templates/user/auth/signup_inner.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
</button>
4848
</div>
4949
{{end}}
50-
51-
{{if and .OAuth2Providers .EnableOpenIDSignIn}}
50+
{{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}}
51+
{{if $showOAuth2Methods}}
5252
<div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
5353
{{template "user/auth/oauth_container" .}}
5454
{{end}}

0 commit comments

Comments
 (0)