Skip to content

Commit

Permalink
#8 feat: 토큰 예외 처리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sojungpp committed Mar 4, 2023
1 parent 0684307 commit 61ef293
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public enum BaseResponseStatus {
INVALID_PROVIDER(false, 2003, "잘못된 소셜 이름입니다."),
ALREADY_WITHDRAW_USER(false, 2004, "이미 탈퇴한 회원입니다."),
INVALID_TOKEN(false, 2005, "유효하지 않은 토큰 값입니다."),
UNSUPPORTED_TOKEN(false, 2006, "잘못된 형식의 토큰 값입니다."),
MALFORMED_TOKEN(false, 2007, "잘못된 구조의 토큰 값입니다."),


// stores(2100~2199)
NULL_ADDRESS(false, 2100, "주소를 입력해주세요."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public Jws<Claims> getClaims(String token) throws BaseException{
.parseClaimsJws(token);
} catch (ExpiredJwtException expiredJwtException) {
throw new BaseException(EXPIRED_TOKEN);
} catch (MalformedJwtException malformedJwtException) {
throw new BaseException(MALFORMED_TOKEN);
} catch (UnsupportedJwtException unsupportedJwtException) {
throw new BaseException(UNSUPPORTED_TOKEN);
} catch (Exception e) {
throw new BaseException(INVALID_TOKEN);
}
Expand Down

0 comments on commit 61ef293

Please sign in to comment.