Skip to content

Commit

Permalink
fix : jwt 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
1000kkannoo committed Jun 13, 2024
1 parent fcd217b commit 1289387
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.moim.backend.global.auth.jwt.JwtService;
import com.moim.backend.global.common.Result;
import com.moim.backend.global.common.exception.CustomException;
import io.jsonwebtoken.ExpiredJwtException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
Expand All @@ -29,12 +30,8 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons

String authorization = request.getHeader(AUTHORIZATION);
if (authorization != null) {
try {
String token = jwtService.getToken(Optional.of(authorization));
jwtService.validateToken(token);
} catch (Exception e) {
throw new CustomException(Result.FAIL);
}
String token = jwtService.getToken(Optional.of(authorization));
jwtService.validateToken(token);
}

return true;
Expand Down

0 comments on commit 1289387

Please sign in to comment.