fix(auth): 增加 JWT 安全版本号与 TokenManager.invalidateUserSessions,统一角色与密码变更的按用户下线行为

Closes #ID8B31
This commit is contained in:
Ray.Hao
2025-12-02 17:34:36 +08:00
parent 6e8769ccb7
commit 289f79cdb4
9 changed files with 132 additions and 57 deletions

View File

@@ -35,4 +35,9 @@ public interface JwtClaimConstants {
*/
String AUTHORITIES = "authorities";
/**
* 安全版本号,用于按用户失效历史令牌
*/
String SECURITY_VERSION = "securityVersion";
}

View File

@@ -36,6 +36,8 @@ public interface RedisConstants {
String USER_REFRESH_TOKEN = "auth:user:refresh:{}";
// 黑名单 Token用于退出登录或注销
String BLACKLIST_TOKEN = "auth:token:blacklist:{}";
// 用户安全版本号(用于按用户失效历史 JWT
String USER_SECURITY_VERSION = "auth:user:security_version:{}";
}
/**