Merge pull request 'feat: Add option to disable builtin authentication' (#6112) from squel/forgejo-disable-internal-signin into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6112
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
Gusted 2024-12-01 19:02:05 +00:00
commit d35bc0e636
6 changed files with 59 additions and 0 deletions

View file

@ -1,7 +1,9 @@
{{if or .OAuth2Providers .EnableOpenIDSignIn}}
{{if .EnableInternalSignIn}}
<div class="divider divider-text">
{{ctx.Locale.Tr "sign_in_or"}}
</div>
{{end}}
<div id="oauth2-login-navigator" class="tw-py-1">
<div class="tw-flex tw-flex-col tw-justify-center">
<div id="oauth2-login-navigator-inner" class="tw-flex tw-flex-col tw-flex-wrap tw-items-center tw-gap-2">

View file

@ -10,6 +10,7 @@
{{end}}
</h4>
<div class="ui attached segment">
{{if .EnableInternalSignIn}}
<form class="ui form" action="{{.SignInLink}}" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
@ -43,6 +44,7 @@
</button>
</div>
</form>
{{end}}
{{template "user/auth/oauth_container" .}}
</div>