Skip to content

Commit

Permalink
♻️ Refactor: 토큰 유효성 검사 실패 시 단순 false만 반환하도록 수정 (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
win-luck committed Nov 7, 2023
1 parent 4c2e82f commit 57a6243
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.diareat.diareat.auth.component;

import com.diareat.diareat.util.api.ResponseCode;
import com.diareat.diareat.util.exception.UserException;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
Expand Down Expand Up @@ -63,7 +61,7 @@ public boolean validateToken(String jwtToken) {
Jws<Claims> claims = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(jwtToken);
return !claims.getBody().getExpiration().before(new Date());
} catch (Exception e) {
throw new UserException(ResponseCode.TOKEN_VALIDATION_FAILURE);
return false;
}
}

Expand Down

0 comments on commit 57a6243

Please sign in to comment.