File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
gdgoc/src/main/java/inha/gdgoc/domain/auth/service Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments