File tree 1 file changed +7
-1
lines changed
src/main/java/com/example/security/jwt/account/presentation
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public ResponseEntity<CommonResponse> refreshToken(@Valid @RequestBody RequestAc
64
64
* Authorization : Bearer {AccessToken}
65
65
* @AuthenticationPrincipal를 통해 JwtFilter에서 토큰을 검증하며 등록한 시큐리티 유저 객체를 꺼내옴
66
66
* JwtFilter는 디비 조회 X
67
+ * 토큰 유저 조회
67
68
*/
68
69
@ GetMapping ("/user" )
69
70
@ PreAuthorize ("hasAnyRole('MEMBER','ADMIN')" ) // USER, ADMIN 권한 둘 다 호출 허용
@@ -80,8 +81,13 @@ public ResponseEntity<CommonResponse> getMyUserInfo(@AuthenticationPrincipal Use
80
81
return ResponseEntity .ok (response );
81
82
}
82
83
84
+ /**
85
+ * 해당 계정의 가중치를 1 올린다. -> 리플레쉬 토큰 무효
86
+ * @param userName
87
+ * @return
88
+ */
83
89
@ DeleteMapping ("/{userName}/token" )
84
- @ PreAuthorize ("hasAnyRole('ADMIN')" ) // ADMIN 권한만 호출 가능
90
+ @ PreAuthorize ("hasAnyRole('ADMIN')" )
85
91
public ResponseEntity <CommonResponse > authorize (@ PathVariable String userName ) {
86
92
accountService .invalidateRefreshTokenByUsername (userName );
87
93
//응답
You can’t perform that action at this time.
0 commit comments