From f73eb9571f1a7a4cf407b5288ea2f1b55c7bd7a4 Mon Sep 17 00:00:00 2001 From: Stavros Date: Fri, 11 Jul 2025 16:16:44 +0300 Subject: [PATCH] fix: fix password reset message translations --- cmd/root.go | 2 +- frontend/src/lib/i18n/locales/en-US.json | 3 ++- frontend/src/lib/i18n/locales/en.json | 3 ++- frontend/src/pages/forgot-password-page.tsx | 2 +- internal/types/config.go | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index b364cfb..4ab8fa7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -243,7 +243,7 @@ func init() { rootCmd.Flags().Int("login-max-retries", 5, "Maximum login attempts before timeout (0 to disable).") rootCmd.Flags().Int("log-level", 1, "Log level.") rootCmd.Flags().String("app-title", "Tinyauth", "Title of the app.") - rootCmd.Flags().String("forgot-password-message", "You can reset your password by changing the `USERS` environment variable.", "Message to show on the forgot password page.") + rootCmd.Flags().String("forgot-password-message", "", "Message to show on the forgot password page.") rootCmd.Flags().String("background-image", "/background.jpg", "Background image URL for the login page.") rootCmd.Flags().String("ldap-address", "", "LDAP server address (e.g. ldap://localhost:389).") rootCmd.Flags().String("ldap-bind-dn", "", "LDAP bind DN (e.g. uid=user,dc=example,dc=com).") diff --git a/frontend/src/lib/i18n/locales/en-US.json b/frontend/src/lib/i18n/locales/en-US.json index 0eae0bc..05386de 100644 --- a/frontend/src/lib/i18n/locales/en-US.json +++ b/frontend/src/lib/i18n/locales/en-US.json @@ -50,5 +50,6 @@ "forgotPasswordTitle": "Forgot your password?", "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", "errorTitle": "An error occurred", - "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information." + "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", + "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." } \ No newline at end of file diff --git a/frontend/src/lib/i18n/locales/en.json b/frontend/src/lib/i18n/locales/en.json index 0eae0bc..05386de 100644 --- a/frontend/src/lib/i18n/locales/en.json +++ b/frontend/src/lib/i18n/locales/en.json @@ -50,5 +50,6 @@ "forgotPasswordTitle": "Forgot your password?", "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", "errorTitle": "An error occurred", - "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information." + "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", + "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." } \ No newline at end of file diff --git a/frontend/src/pages/forgot-password-page.tsx b/frontend/src/pages/forgot-password-page.tsx index c98ff5b..e7b359a 100644 --- a/frontend/src/pages/forgot-password-page.tsx +++ b/frontend/src/pages/forgot-password-page.tsx @@ -17,7 +17,7 @@ export const ForgotPasswordPage = () => { {t("forgotPasswordTitle")} - {forgotPasswordMessage} + {forgotPasswordMessage !== "" ? forgotPasswordMessage : t('forgotPasswordMessage')} diff --git a/internal/types/config.go b/internal/types/config.go index a09a59e..b53e053 100644 --- a/internal/types/config.go +++ b/internal/types/config.go @@ -34,7 +34,7 @@ type Config struct { EnvFile string `mapstructure:"env-file"` LoginTimeout int `mapstructure:"login-timeout"` LoginMaxRetries int `mapstructure:"login-max-retries"` - FogotPasswordMessage string `mapstructure:"forgot-password-message" validate:"required"` + FogotPasswordMessage string `mapstructure:"forgot-password-message"` BackgroundImage string `mapstructure:"background-image" validate:"required"` LdapAddress string `mapstructure:"ldap-address"` LdapBindDN string `mapstructure:"ldap-bind-dn"`