Skip to content

Commit 87386a9

Browse files
authored
[FIX] 쿠키 파싱 오류 해결
[FIX] 쿠키 파싱 오류 해결
2 parents 15998bb + 7170120 commit 87386a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gdgoc/src/main/java/inha/gdgoc/domain/auth/service/RefreshTokenService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public String refreshAccessToken(String refreshToken) {
4747

4848
Claims claims = tokenProvider.validToken(refreshToken);
4949
try {
50-
Long userId = Long.parseLong(claims.getSubject());
51-
Optional<User> optionalUser = userRepository.findById(userId);
50+
String email = claims.getSubject(); // 이메일로 변경
51+
Optional<User> optionalUser = userRepository.findByEmail(email);
5252

5353
if (optionalUser.isEmpty()) {
5454
throw new RuntimeException("User not found");
@@ -61,8 +61,9 @@ public String refreshAccessToken(String refreshToken) {
6161
}
6262

6363
return tokenProvider.generateGoogleLoginToken(user, Duration.ofHours(1));
64-
} catch (NumberFormatException e) {
64+
} catch (Exception e) {
6565
throw new RuntimeException(e);
6666
}
6767
}
68+
6869
}

0 commit comments

Comments
 (0)