Skip to content

Commit

Permalink
Merge pull request #137 from 05AM/feature/admin-login
Browse files Browse the repository at this point in the history
#135 [FIX] Bearer 검증 오류 수정
  • Loading branch information
05AM authored Oct 28, 2023
2 parents 643f59f + 08be14b commit 62b36d2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Object resolveArgument(
final HttpServletRequest request = (HttpServletRequest) webRequest.getNativeRequest();
final String bearerHeader = request.getHeader("Authorization");

if (jwtService.validateBearerHeader(bearerHeader)) {
if (!jwtService.validateBearerHeader(bearerHeader)) {
throw new BusinessException(ErrorType.NOT_SUPPORTED_JWT_TOKEN_EXCEPTION);
}

Expand All @@ -53,7 +53,7 @@ public Object resolveArgument(
try {
UserRole role = UserRole.valueOf(content.getRole());
Integer userId = Integer.parseInt(content.getUserId());

if (!role.equals(UserRole.USER)) {
throw new BusinessException(ErrorType.INVALID_JWT_TOKEN_EXCEPTION);
}
Expand Down

0 comments on commit 62b36d2

Please sign in to comment.