Skip to content

Commit

Permalink
[chore] 넘어오는 토큰 log 찍기
Browse files Browse the repository at this point in the history
  • Loading branch information
khee2 committed Jun 12, 2024
1 parent e061aa9 commit 311ec58
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class MessageController {
public void message(@RequestHeader(name = "ACCESS_TOKEN", required = false) String accessToken,
MessageDto messageDto) {
try {
log.debug("Received ACCESS_TOKEN: {}", accessToken);
// Access Token 검증
if (accessToken != null && accessToken.startsWith("Bearer ")) {
String token = accessToken.substring(7);
Expand All @@ -53,7 +54,7 @@ public void message(@RequestHeader(name = "ACCESS_TOKEN", required = false) Stri
throw new AccessDeniedException("Invalid or expired token");
}
} else {
throw new AccessDeniedException("Missing or invalid ACCESS_TOKEN header");
throw new AccessDeniedException("Missing or invalid ACCESS_TOKEN header!");
}
} catch (Exception e) {
log.error("Failed to send message: {}", e.getMessage());
Expand Down

0 comments on commit 311ec58

Please sign in to comment.