Skip to content

Commit

Permalink
Merge pull request #30 from SafeNet-2024/feature/add-security
Browse files Browse the repository at this point in the history
[chore] ๋„˜์–ด์˜ค๋Š” ํ† ํฐ log ์ฐ๊ธฐ
  • Loading branch information
khee2 authored Jun 12, 2024
2 parents bc63cce + 02ac050 commit 8fd4c6a
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 8fd4c6a

Please sign in to comment.