diff --git a/internal/httpd/webadmin.go b/internal/httpd/webadmin.go index a1b33592..f3837054 100644 --- a/internal/httpd/webadmin.go +++ b/internal/httpd/webadmin.go @@ -494,7 +494,7 @@ func loadAdminTemplates(templatesPath string) { filepath.Join(templatesPath, templateAdminDir, templateIPList), } mfaPaths := []string{ - filepath.Join(templatesPath, templateCommonDir, templateCommonCSS), + filepath.Join(templatesPath, templateCommonDir, templateCommonBase), filepath.Join(templatesPath, templateAdminDir, templateBase), filepath.Join(templatesPath, templateAdminDir, templateMFA), } diff --git a/templates/common/message.html b/templates/common/message.html index f6a8c271..da749a9e 100644 --- a/templates/common/message.html +++ b/templates/common/message.html @@ -71,7 +71,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
{{- if .Text}} - {{.Text}} + {{.Text}} {{- end}}
diff --git a/templates/webadmin/mfa.html b/templates/webadmin/mfa.html index 77a38c78..89a38e59 100644 --- a/templates/webadmin/mfa.html +++ b/templates/webadmin/mfa.html @@ -1,60 +1,78 @@ {{template "base" .}} -{{define "title"}}{{.Title}}{{end}} - -{{define "extra_css"}} - -{{end}} - -{{define "page_body"}} - -
-
-
TOTP (Authenticator app)
-
-
- - - -
-

Status: {{if .TOTPConfig.Enabled }}"Enabled". Current configuration: "{{.TOTPConfig.ConfigName}}"{{else}}"Disabled"{{end}}

-
-
-
- Disable +{{- define "page_body"}} +{{- if .TOTPConfig.Enabled}} +
+ + + + +
+
+

+ {{- if gt (len .TOTPConfigs) 1 }} + ({{$.TOTPConfig.ConfigName}}) {{- end}} +

+
+
-
- -
- + {{range .TOTPConfigs}} {{end}} @@ -62,369 +80,550 @@ along with this program. If not, see .
- - -
-
-

Your new TOTP secret is:

-

For quick setup, scan this QR code with your TOTP app:

- QR code -
-
-
-

After you configured your app, enter a test code below to ensure everything works correctly. Recovery codes are automatically generated if missing or most of them have already been used

-
- -
- - - Verify and save +
+ {{- if .TOTPConfig.Enabled }} + + {{- end}} +
-
-
-
- -{{if .TOTPConfig.Enabled }} -
-
-
Recovery codes
-
-
- - - -
-

Recovery codes are a set of one time use codes that can be used in place of the TOTP to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate TOTP configuration.

-

To keep your account secure, don't share or distribute your recovery codes. We recommend saving them with a secure password manager.

-
-
-
- View -
-
- -
-

If you generate new recovery codes, you automatically invalidate old ones.

-
-
-
- Generate + +
+
+ +{{- if .TOTPConfig.Enabled}} +
+
+

+ +

+
+
+
+

Recovery codes are a set of one time use codes that can be used in place of the authentication code to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate two-factor configuration.

+

To keep your account secure, don't share or distribute your recovery codes. We recommend saving them with a secure password manager.

+

If you generate new recovery codes, you automatically invalidate old ones.

+
+
+ + +
-{{end}} -{{end}} +{{- end}} -{{define "dialog"}} -