Skip to content

Commit

Permalink
Merge pull request #83 from 0702Yoon/main
Browse files Browse the repository at this point in the history
chore : 프론트 토큰 테스트 시간
  • Loading branch information
0702Yoon authored Aug 14, 2024
2 parents 46c438f + 864ccb8 commit 47aac67
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static com.example.bigbrotherbe.global.jwt.entity.TokenDto.ACCESS_TOKEN;
import static com.example.bigbrotherbe.global.jwt.entity.TokenDto.REFRESH_TOKEN;

import com.example.bigbrotherbe.global.exception.BusinessException;
import com.example.bigbrotherbe.global.exception.enums.ErrorCode;
import com.example.bigbrotherbe.global.jwt.entity.TokenDto;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
Expand Down Expand Up @@ -31,7 +33,7 @@
@Component
public class JwtTokenProvider {
private final Key key;
private static final long ACCESS_TIME = 10 * 6L; // 1초
private static final long ACCESS_TIME = 10 * 60 * 1000L; // 1초
private static final long REFRESH_TIME = 30 * 60 * 1000L; //30분
public JwtTokenProvider(@Value("${jwt.secret}") String secretKey){
byte[] keyBytes = Decoders.BASE64.decode(secretKey);
Expand Down Expand Up @@ -95,8 +97,7 @@ public boolean validateToken(String token){
} catch (SecurityException | MalformedJwtException e) {
log.info("잘못된 토큰입니다.", e);
} catch (ExpiredJwtException e) {
// throw new BusinessException(ErrorCode.ACCESS_Token_Expired);
log.info("만료된 토큰입니다.");
throw new BusinessException(ErrorCode.ACCESS_Token_Expired);
} catch (UnsupportedJwtException e) {
log.info("지원하지 않은 토큰입니다.", e);
} catch (IllegalArgumentException e) {
Expand Down

0 comments on commit 47aac67

Please sign in to comment.