Resolved refresh endpoint issues.
Some checks failed
Build & Deploy Backend / build (push) Failing after 36s
Build & Deploy Backend / deploy (push) Has been skipped

This commit is contained in:
2025-10-10 10:54:37 +08:00
parent 9f68959a29
commit 69721ba411

View File

@@ -168,8 +168,13 @@ public class AuthController {
if (token != null && jwtUtil.validateToken(token)) { if (token != null && jwtUtil.validateToken(token)) {
String username = jwtUtil.extractUsername(token); String username = jwtUtil.extractUsername(token);
String displayName = jwtUtil.extractDisplayName(token);
String clientIdentifier = jwtUtil.extractClientIdentifier(token);
Long userId = jwtUtil.extractUserId(token);
List<String> roles = jwtUtil.extractRoles(token);
// Generate new token with extended expiry // Generate new token with extended expiry
String newToken = jwtUtil.generateToken(...); // same params as login String newToken = jwtUtil.generateToken(username, displayName, clientIdentifier, userId, roles);
// Set new cookie // Set new cookie
ResponseCookie cookie = ResponseCookie.from("authToken", newToken) ResponseCookie cookie = ResponseCookie.from("authToken", newToken)