From e3e024876e71d01a6700a7f6fe8861d709de6de6 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 19 Jan 2020 23:37:28 +0000 Subject: Ensure that 2fa is checked on reset-password (#9857) (#9877) * Ensure that 2fa is checked on reset-password * Apply suggestions from code review Co-Authored-By: Lauris BH * Properly manage scratch_code regeneration Co-authored-by: Lauris BH Co-authored-by: Lauris BH --- templates/user/auth/reset_passwd.tmpl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl index e7d939294e..91d5a5ef88 100644 --- a/templates/user/auth/reset_passwd.tmpl +++ b/templates/user/auth/reset_passwd.tmpl @@ -18,7 +18,7 @@ {{end}} {{if .IsResetForm}}
- +
{{if not .user_signed_in}} @@ -30,10 +30,31 @@ {{end}} + {{if .has_two_factor}} +

+ {{.i18n.Tr "twofa"}} +

+
{{.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}
+ {{if .scratch_code}} +
+ + +
+ + {{else}} +
+ + +
+ {{end}} + {{end}}
+ {{if and .has_two_factor (not .scratch_code)}} + {{.i18n.Tr "auth.use_scratch_code" | Str2html}} + {{end}}
{{else}}

{{.i18n.Tr "auth.invalid_code"}}

-- cgit v1.2.3