Created
January 30, 2022 19:51
-
-
Save GaetanoPiazzolla/fcf752ebb3d9712734d800ed1250bb91 to your computer and use it in GitHub Desktop.
LogoutController which writes on RedisCache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("/logout") | |
public class LogoutController { | |
@Autowired | |
private BlackListingService blackListingService; | |
@Autowired | |
private UserRequestScopedBean userRequestScopedBean; | |
@PutMapping | |
public ResponseEntity<Void> logout() { | |
blackListingService.blackListJwt(userRequestScopedBean.getJwt()); | |
return ResponseEntity.ok(null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to medium article: https://blog.devgenius.io/fixing-jwt-insecure-session-termination-by-blacklisting-tokens-36d783adfd67