Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE][FIX] accessToken 만료 시간 수정 #272

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/src/main/java/org/example/backend/jwt/JWTUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public boolean validateToken(String token) {
}
}

public Claims extractClaims(String token) {
public Claims extractClaims(String token) { // JWT 토큰에서 클레임(Claims)을 추출
// 반환된 Claims 객체는 JWT 토큰에 포함된 데이터를 키-값 쌍으로 제공
return Jwts.parserBuilder()
.setSigningKey(key)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ protected void successfulAuthentication(HttpServletRequest request, HttpServletR

String role = auth.getAuthority();

String accessToken = jwtUtil.createJwt(loginId, role, 100000000 * 1800 * 100 * 10L);
String refreshToken = jwtUtil.createJwt(loginId, role, 60 * 60 * 24 * 30 * 1000L);
String accessToken = jwtUtil.createJwt(loginId, role, 1800 * 1000L);

response.addHeader("Authorization", "Bearer " + accessToken);
}
Expand Down
Loading