From 7518836aa44a7a72cb83e3e6e66ec157a85eb6de Mon Sep 17 00:00:00 2001 From: ChaeAg Date: Sat, 7 Dec 2024 02:00:35 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE]=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/websoso/WSSServer/service/UserService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/websoso/WSSServer/service/UserService.java b/src/main/java/org/websoso/WSSServer/service/UserService.java index 9fc6b1c2e..bd0a25914 100644 --- a/src/main/java/org/websoso/WSSServer/service/UserService.java +++ b/src/main/java/org/websoso/WSSServer/service/UserService.java @@ -20,6 +20,7 @@ import org.websoso.WSSServer.domain.Avatar; import org.websoso.WSSServer.domain.Genre; import org.websoso.WSSServer.domain.GenrePreference; +import org.websoso.WSSServer.domain.RefreshToken; import org.websoso.WSSServer.domain.User; import org.websoso.WSSServer.domain.WithdrawalReason; import org.websoso.WSSServer.domain.common.DiscordWebhookMessage; @@ -87,6 +88,12 @@ public LoginResponse login(Long userId) { UserAuthentication userAuthentication = new UserAuthentication(user.getUserId(), null, null); String token = jwtProvider.generateAccessToken(userAuthentication); + String refreshToken = jwtProvider.generateRefreshToken(userAuthentication); + + RefreshToken redisRefreshToken = new RefreshToken(refreshToken, user.getUserId()); + refreshTokenRepository.save(redisRefreshToken); + + System.out.print(refreshToken); return LoginResponse.of(token); }