Resolved refresh endpoint issues.
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user