Change config JWT duration fields to time.Duration

- fix: The AccessTTL and RefreshTTL fields in JWTConfig now use
  time.Duration type directly instead of string with ParseDuration
  methods. The config validation now checks for positive durations
  rather than parsing strings.
This commit is contained in:
2026-04-29 17:02:49 +08:00
parent b4ab864f80
commit f4212cddf0
4 changed files with 23 additions and 33 deletions

View File

@@ -44,8 +44,8 @@ func Bootstrap(cfg *config.Config) (*WebApp, error) {
authService := service.NewAuthService(
userRepo, sessionRepo, credentialRepo,
jwtSecret,
cfg.JWT.AccessDuration(),
cfg.JWT.RefreshDuration(),
cfg.JWT.AccessTTL,
cfg.JWT.RefreshTTL,
)
return &WebApp{