diff --git a/internal/httpd/web.go b/internal/httpd/web.go index a14ba497..877adaf7 100644 --- a/internal/httpd/web.go +++ b/internal/httpd/web.go @@ -27,23 +27,20 @@ import ( ) const ( - pageMFATitle = "Two-factor authentication" - pageTwoFactorTitle = "Two-Factor authentication" - pageTwoFactorRecoveryTitle = "Two-Factor recovery" - webDateTimeFormat = "2006-01-02 15:04:05" // YYYY-MM-DD HH:MM:SS - redactedSecret = "[**redacted**]" - csrfFormToken = "_form_token" - csrfHeaderToken = "X-CSRF-TOKEN" - templateCommonDir = "common" - templateTwoFactor = "twofactor.html" - templateTwoFactorRecovery = "twofactor-recovery.html" - templateForgotPassword = "forgot-password.html" - templateResetPassword = "reset-password.html" - templateChangePwd = "changepassword.html" - templateMessage = "message.html" - templateCommonBase = "base.html" - templateCommonBaseLogin = "baselogin.html" - templateCommonLogin = "login.html" + webDateTimeFormat = "2006-01-02 15:04:05" // YYYY-MM-DD HH:MM:SS + redactedSecret = "[**redacted**]" + csrfFormToken = "_form_token" + csrfHeaderToken = "X-CSRF-TOKEN" + templateCommonDir = "common" + templateTwoFactor = "twofactor.html" + templateTwoFactorRecovery = "twofactor-recovery.html" + templateForgotPassword = "forgot-password.html" + templateResetPassword = "reset-password.html" + templateChangePwd = "changepassword.html" + templateMessage = "message.html" + templateCommonBase = "base.html" + templateCommonBaseLogin = "baselogin.html" + templateCommonLogin = "login.html" ) var ( diff --git a/internal/httpd/webadmin.go b/internal/httpd/webadmin.go index a32afca0..e2ca9326 100644 --- a/internal/httpd/webadmin.go +++ b/internal/httpd/webadmin.go @@ -752,7 +752,7 @@ func (s *httpdServer) renderResetPwdPage(w http.ResponseWriter, r *http.Request, func (s *httpdServer) renderTwoFactorPage(w http.ResponseWriter, r *http.Request, err *util.I18nError) { data := twoFactorPage{ commonBasePage: getCommonBasePage(r), - Title: pageTwoFactorTitle, + Title: util.I18n2FATitle, CurrentURL: webAdminTwoFactorPath, Error: err, CSRFToken: createCSRFToken(w, r, s.csrfTokenAuth, "", webBaseAdminPath), @@ -766,7 +766,7 @@ func (s *httpdServer) renderTwoFactorPage(w http.ResponseWriter, r *http.Request func (s *httpdServer) renderTwoFactorRecoveryPage(w http.ResponseWriter, r *http.Request, err *util.I18nError) { data := twoFactorPage{ commonBasePage: getCommonBasePage(r), - Title: pageTwoFactorRecoveryTitle, + Title: util.I18n2FATitle, CurrentURL: webAdminTwoFactorRecoveryPath, Error: err, CSRFToken: createCSRFToken(w, r, s.csrfTokenAuth, "", webBaseAdminPath), @@ -778,7 +778,7 @@ func (s *httpdServer) renderTwoFactorRecoveryPage(w http.ResponseWriter, r *http func (s *httpdServer) renderMFAPage(w http.ResponseWriter, r *http.Request) { data := mfaPage{ - basePage: s.getBasePageData(pageMFATitle, webAdminMFAPath, w, r), + basePage: s.getBasePageData(util.I18n2FATitle, webAdminMFAPath, w, r), TOTPConfigs: mfa.GetAvailableTOTPConfigNames(), GenerateTOTPURL: webAdminTOTPGeneratePath, ValidateTOTPURL: webAdminTOTPValidatePath, diff --git a/internal/httpd/webclient.go b/internal/httpd/webclient.go index b66b7c54..017ae875 100644 --- a/internal/httpd/webclient.go +++ b/internal/httpd/webclient.go @@ -643,7 +643,7 @@ func (s *httpdServer) renderClientNotFoundPage(w http.ResponseWriter, r *http.Re func (s *httpdServer) renderClientTwoFactorPage(w http.ResponseWriter, r *http.Request, err *util.I18nError) { data := twoFactorPage{ commonBasePage: getCommonBasePage(r), - Title: pageTwoFactorTitle, + Title: util.I18n2FATitle, CurrentURL: webClientTwoFactorPath, Error: err, CSRFToken: createCSRFToken(w, r, s.csrfTokenAuth, "", webBaseClientPath), @@ -660,7 +660,7 @@ func (s *httpdServer) renderClientTwoFactorPage(w http.ResponseWriter, r *http.R func (s *httpdServer) renderClientTwoFactorRecoveryPage(w http.ResponseWriter, r *http.Request, err *util.I18nError) { data := twoFactorPage{ commonBasePage: getCommonBasePage(r), - Title: pageTwoFactorRecoveryTitle, + Title: util.I18n2FATitle, CurrentURL: webClientTwoFactorRecoveryPath, Error: err, CSRFToken: createCSRFToken(w, r, s.csrfTokenAuth, "", webBaseClientPath),