Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ JWT 테스트 컨트롤러 추가 (#121)
Browse files Browse the repository at this point in the history
MinseoKangQ authored Nov 15, 2024
1 parent fc6f704 commit e16798a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -22,4 +22,16 @@ public SuccessResponse<String> testException() {
throw new TestNotFoundException();
}

@GetMapping("/jwt-test")
public SuccessResponse<String> testJwt(Authentication authentication) {
if (authentication == null) {
return SuccessResponse.of("token is null");
}
else {
CustomOAuth2User customOAuth2User = (CustomOAuth2User) authentication.getPrincipal();
String providerId = customOAuth2User.getUsername();
return SuccessResponse.of(providerId);
}
}

}

0 comments on commit e16798a

Please sign in to comment.