Fix oauth2 login methods (#32698)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run

Regression of #32687

It should use "or" but not "and", otherwise the oauth2 methods won't
show when no ENABLE_OPENID_SIGNIN
This commit is contained in:
wxiaoguang 2024-12-04 01:53:57 +08:00 committed by GitHub
parent 690d07470c
commit 171edfc793
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -48,10 +48,11 @@
</div>
</form>
{{end}}{{/*if .EnablePasswordSignInForm*/}}
{{if and .OAuth2Providers .EnableOpenIDSignIn .EnablePasswordSignInForm}}
{{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}}
{{if and $showOAuth2Methods .EnablePasswordSignInForm}}
<div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
{{end}}
{{if and .OAuth2Providers .EnableOpenIDSignIn}}
{{if $showOAuth2Methods}}
{{template "user/auth/oauth_container" .}}
{{end}}
</div>

View File

@ -47,8 +47,8 @@
</button>
</div>
{{end}}
{{if and .OAuth2Providers .EnableOpenIDSignIn}}
{{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn}}
{{if $showOAuth2Methods}}
<div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
{{template "user/auth/oauth_container" .}}
{{end}}