diff --git a/.env.example b/.env.example index 7d0ad4e..92d251f 100644 --- a/.env.example +++ b/.env.example @@ -7,13 +7,3 @@ DB_NAME=mailserver # Security - JWT secret must be at least 32 characters JWT_SECRET=your-secret-key-at-least-32-chars - -# SMTP settings for password reset emails -SMTP_HOST=localhost -SMTP_PORT=587 -SMTP_USER= -SMTP_PASSWORD= -SMTP_FROM=noreply@yourdomain.com - -# Application URL -BASE_URL=http://localhost:8080 diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index a499ad7..59f7762 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -112,6 +112,9 @@ func (c *Config) Validate() error { if len(c.JWTSecret) < 32 { return fmt.Errorf("JWT_SECRET must be at least 32 characters long") } + if c.JWTSecret == "your-secret-key-at-least-32-chars" { + return fmt.Errorf("JWT_SECRET must not be the default value") + } return nil }