Skip to content

Commit

Permalink
fix: temporary change to auth logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mushroom1324 committed Sep 25, 2024
1 parent 0f2f810 commit 797c52d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/main/java/com/example/repick/global/jwt/TokenService.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,24 @@ public String resolveToken(HttpServletRequest request) {

// 토큰 검증
public boolean validateToken(String token) {
try {
// Bearer 검증
if (!token.substring(0, "BEARER ".length()).equalsIgnoreCase("BEARER ")) {
return false;
} else {
token = token.split(" ")[1].trim();
}
JwtParser build = Jwts.parserBuilder()
.setSigningKey(secretKey)
.build();

Jws<Claims> claims = build.parseClaimsJws(token);

// λ§Œλ£Œλ˜μ—ˆμ„ μ‹œ false
return true;
// try {
// // Bearer 검증
// if (!token.substring(0, "BEARER ".length()).equalsIgnoreCase("BEARER ")) {
// return false;
// } else {
// token = token.split(" ")[1].trim();
// }
// JwtParser build = Jwts.parserBuilder()
// .setSigningKey(secretKey)
// .build();
//
// Jws<Claims> claims = build.parseClaimsJws(token);
//
// // λ§Œλ£Œλ˜μ—ˆμ„ μ‹œ false
// return !claims.getBody().getExpiration().before(new Date());
return true;
} catch (Exception e) {
return false;
}
// } catch (Exception e) {
// return false;
// }
}
}

0 comments on commit 797c52d

Please sign in to comment.