fix(jwt): 修复仅配置小时时会话提前失效问题
- 将 jwt.access_token_expire_minutes 默认值改为 0,未显式配置时回退 expire_hour - 调整配置校验为允许 0,仅拒绝负数并补充优先级注释 - 新增配置与认证服务单元测试,覆盖分钟优先与小时回退场景 - 更新示例配置文档,明确分钟/小时优先级与默认行为
This commit is contained in:
@@ -663,9 +663,14 @@ jwt:
|
||||
# 重要:生产环境中请更改为随机字符串!
|
||||
# Generate with / 生成命令: openssl rand -hex 32
|
||||
secret: "change-this-to-a-secure-random-string"
|
||||
# Token expiration time in hours (max 24)
|
||||
# 令牌过期时间(小时,最大 24)
|
||||
# Token expiration time in hours (max 168)
|
||||
# 令牌过期时间(小时,最大 168)
|
||||
expire_hour: 24
|
||||
# Access Token 过期时间(分钟)
|
||||
# 优先级说明:
|
||||
# - >0: 按分钟生效(优先于 expire_hour)
|
||||
# - =0: 回退使用 expire_hour
|
||||
access_token_expire_minutes: 0
|
||||
|
||||
# =============================================================================
|
||||
# TOTP (2FA) Configuration
|
||||
|
||||
Reference in New Issue
Block a user