feat: Add JWT configuration to environment and refactor JWT middleware to use new config structure
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
Reference in New Issue
Block a user