1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 16:44:26 +00:00

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
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> </div>
</form> </form>
{{end}}{{/*if .EnablePasswordSignInForm*/}} {{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> <div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
{{end}} {{end}}
{{if and .OAuth2Providers .EnableOpenIDSignIn}} {{if $showOAuth2Methods}}
{{template "user/auth/oauth_container" .}} {{template "user/auth/oauth_container" .}}
{{end}} {{end}}
</div> </div>

View File

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