feat: Add JWT configuration to environment and refactor JWT middleware to use new config structure

This commit is contained in:
2025-03-11 23:37:15 +00:00
parent 9057adebdd
commit b545392f27
4 changed files with 56 additions and 90 deletions
+10
View File
@@ -0,0 +1,10 @@
package models
import "time"
type JWTConfig struct {
Secret string `env:"JWT_SECRET" default:""`
TokenDuration time.Duration `env:"JWT_TOKEN_DURATION" default:"24h"`
KeyGenerate bool `env:"JWT_KEY_GENERATE" default:"false"`
KeyDir string `env:"JWT_KEY_DIR" default:"./keys"`
}