diff --git a/controller/config.go b/controller/config.go index 012827b6..18149472 100644 --- a/controller/config.go +++ b/controller/config.go @@ -11,22 +11,18 @@ import ( const ConfigVersion = 1 type Config struct { - V int - Account *AccountConfig - Admin *AdminConfig - Endpoint *EndpointConfig - Email *EmailConfig - Influx *InfluxConfig - Limits *LimitsConfig - Maintenance *MaintenanceConfig - Metrics *MetricsConfig - Registration *RegistrationConfig - Store *store.Config - Ziti *ZitiConfig -} - -type AccountConfig struct { - ForgotPasswordUrlTemplate string + V int + ResetPassword *ResetPasswordConfig + Admin *AdminConfig + Endpoint *EndpointConfig + Email *EmailConfig + Influx *InfluxConfig + Limits *LimitsConfig + Maintenance *MaintenanceConfig + Metrics *MetricsConfig + Registration *RegistrationConfig + Store *store.Config + Ziti *ZitiConfig } type AdminConfig struct { @@ -51,6 +47,10 @@ type RegistrationConfig struct { TokenStrategy string } +type ResetPasswordConfig struct { + ResetUrlTemplate string +} + type ZitiConfig struct { ApiEndpoint string Username string @@ -69,8 +69,8 @@ type InfluxConfig struct { } type MaintenanceConfig struct { - Account *AccountMaintenanceConfig - Registration *RegistrationMaintenanceConfig + ResetPassword *ResetPasswordMaintenanceConfig + Registration *RegistrationMaintenanceConfig } type RegistrationMaintenanceConfig struct { @@ -79,7 +79,7 @@ type RegistrationMaintenanceConfig struct { BatchLimit int } -type AccountMaintenanceConfig struct { +type ResetPasswordMaintenanceConfig struct { ExpirationTimeout time.Duration CheckFrequency time.Duration BatchLimit int @@ -102,7 +102,7 @@ func DefaultConfig() *Config { ServiceName: "metrics", }, Maintenance: &MaintenanceConfig{ - Account: &AccountMaintenanceConfig{ + ResetPassword: &ResetPasswordMaintenanceConfig{ ExpirationTimeout: time.Minute * 15, CheckFrequency: time.Minute * 15, BatchLimit: 500, diff --git a/controller/controller.go b/controller/controller.go index 970035dc..394698a7 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -29,10 +29,10 @@ func Run(inCfg *Config) error { api := operations.NewZrokAPI(swaggerSpec) api.KeyAuth = newZrokAuthenticator(cfg).authenticate api.AccountInviteHandler = newInviteHandler(cfg) - api.AccountForgotPasswordHandler = newForgetPasswordHandler() api.AccountLoginHandler = account.LoginHandlerFunc(loginHandler) api.AccountRegisterHandler = newRegisterHandler() api.AccountResetPasswordHandler = newResetPasswordHandler() + api.AccountResetPasswordRequestHandler = newResetPasswordRequestHandler() api.AccountVerifyHandler = newVerifyHandler() api.AdminCreateFrontendHandler = newCreateFrontendHandler() api.AdminCreateIdentityHandler = newCreateIdentityHandler() @@ -84,8 +84,8 @@ func Run(inCfg *Config) error { if cfg.Maintenance.Registration != nil { go newRegistrationMaintenanceAgent(ctx, cfg.Maintenance.Registration).run() } - if cfg.Maintenance.Account != nil { - go newAccountMaintenanceAgent(ctx, cfg.Maintenance.Account).run() + if cfg.Maintenance.ResetPassword != nil { + go newMaintenanceResetPasswordAgent(ctx, cfg.Maintenance.ResetPassword).run() } } diff --git a/controller/emailUi/embed.go b/controller/emailUi/embed.go index 81194fe9..ddb7389a 100644 --- a/controller/emailUi/embed.go +++ b/controller/emailUi/embed.go @@ -2,5 +2,5 @@ package emailUi import "embed" -//go:embed verify.gohtml verify.gotext forgotPassword.gohtml forgotPassword.gotext +//go:embed verify.gohtml verify.gotext resetPassword.gohtml resetPassword.gotext var FS embed.FS diff --git a/controller/emailUi/forgotPassword.gotext b/controller/emailUi/forgotPassword.gotext deleted file mode 100644 index d1ba3092..00000000 --- a/controller/emailUi/forgotPassword.gotext +++ /dev/null @@ -1,5 +0,0 @@ -We see you requested a forgot password request, {{ .EmailAddress }}! - -Please click this link to change your zrok account password: - -{{ .ForgotPasswordUrl }} \ No newline at end of file diff --git a/controller/emailUi/forgotPassword.gohtml b/controller/emailUi/resetPassword.gohtml similarity index 95% rename from controller/emailUi/forgotPassword.gohtml rename to controller/emailUi/resetPassword.gohtml index 6ad373bc..8dc2e819 100644 --- a/controller/emailUi/forgotPassword.gohtml +++ b/controller/emailUi/resetPassword.gohtml @@ -185,8 +185,8 @@
-Please click this to change your zrok
account password.