Invalidate authorization cookie on logout

This commit is contained in:
Giuseppe Digilio
2020-01-09 16:29:55 +01:00
parent bbfc373bdc
commit bf1e9780d4

View File

@@ -113,6 +113,7 @@ public class JWTTokenRestAuthenticationServiceImpl implements RestAuthentication
String token = getToken(request);
Cookie cookie = new Cookie(AUTHORIZATION_COOKIE, "");
cookie.setHttpOnly(true);
cookie.setMaxAge(0);
response.addCookie(cookie);
jwtTokenHandler.invalidateToken(token, request, context);
}