diff options
author | Kamil DomaĆski <kamil@domanski.co> | 2021-11-08 23:47:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 23:47:19 +0100 |
commit | 021df29623bb0155b5a2ccad0e5f90fb348c8f4e (patch) | |
tree | c720bc34bd29620028c51d35c6d98044af89101e /templates/user/auth | |
parent | a3f9e9234cbb099b821a6ea9c575927be18948de (diff) | |
download | gitea-021df29623bb0155b5a2ccad0e5f90fb348c8f4e.tar.gz gitea-021df29623bb0155b5a2ccad0e5f90fb348c8f4e.zip |
Allow U2F 2FA without TOTP (#11573)
This change enables the usage of U2F without being forced to enroll an TOTP authenticator.
The `/user/auth/u2f` has been changed to hide the "use TOTP instead" bar if TOTP is not enrolled.
Fixes #5410
Fixes #17495
Diffstat (limited to 'templates/user/auth')
-rw-r--r-- | templates/user/auth/u2f.tmpl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/templates/user/auth/u2f.tmpl b/templates/user/auth/u2f.tmpl index 2013d14937..8b04866bbc 100644 --- a/templates/user/auth/u2f.tmpl +++ b/templates/user/auth/u2f.tmpl @@ -12,9 +12,11 @@ <p>{{.i18n.Tr "u2f_sign_in"}}</p> </div> <div id="wait-for-key" class="ui attached segment"><div class="ui active indeterminate inline loader"></div> {{.i18n.Tr "u2f_press_button"}} </div> - <div class="ui attached segment"> - <a href="{{AppSubUrl}}/user/two_factor">{{.i18n.Tr "u2f_use_twofa"}}</a> - </div> + {{if .TOTPEnrolled}} + <div class="ui attached segment"> + <a href="{{AppSubUrl}}/user/two_factor">{{.i18n.Tr "u2f_use_twofa"}}</a> + </div> + {{end}} </div> </div> </div> |