aboutsummaryrefslogtreecommitdiffstats
path: root/templates/admin
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-09-10 17:37:57 +0100
committerGitHub <noreply@github.com>2021-09-10 18:37:57 +0200
commit9ca0e7905c24f18ed246e65397589f0f41b50506 (patch)
tree5c0c03dc297f47e7f60711563efbaf87993463a6 /templates/admin
parent51578d64188a7077848cb60d3ead8e818637ab59 (diff)
downloadgitea-9ca0e7905c24f18ed246e65397589f0f41b50506.tar.gz
gitea-9ca0e7905c24f18ed246e65397589f0f41b50506.zip
Add setting to OAuth handlers to skip local 2FA authentication (#16594)
This PR adds a setting to OAuth and OpenID login sources to allow the source to skip local 2FA authentication. Fix #13939 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates/admin')
-rw-r--r--templates/admin/auth/edit.tmpl7
-rw-r--r--templates/admin/auth/source/oauth.tmpl7
2 files changed, 14 insertions, 0 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index 109186a178..3e21710353 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -255,6 +255,13 @@
<label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}">
</div>
+ <div class="optional field">
+ <div class="ui checkbox">
+ <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+ <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}>
+ <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+ </div>
+ </div>
<div class="oauth2_use_custom_url inline field">
<div class="ui checkbox">
diff --git a/templates/admin/auth/source/oauth.tmpl b/templates/admin/auth/source/oauth.tmpl
index b19fe3d428..6e91da14e2 100644
--- a/templates/admin/auth/source/oauth.tmpl
+++ b/templates/admin/auth/source/oauth.tmpl
@@ -28,6 +28,13 @@
<label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
<input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{.open_id_connect_auto_discovery_url}}">
</div>
+ <div class="optional field">
+ <div class="ui checkbox">
+ <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+ <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}>
+ <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+ </div>
+ </div>
<div class="oauth2_use_custom_url inline field">
<div class="ui checkbox">