diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/redis/RedisAdapter.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/redis/RedisAdapter.java index a8941b4e..ba720ee3 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/redis/RedisAdapter.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/out/redis/RedisAdapter.java @@ -16,8 +16,8 @@ public class RedisAdapter implements CodePort { private final RedisUtils redisUtils; @Override - public void saveWithExpiration(String email, String code, Long expiredTime) { - redisUtils.setData(email, code, expiredTime); + public void saveWithExpiration(String key, String code, Long expiredTime) { + redisUtils.setData(key, code, expiredTime); } @Override diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/application/service/auth/AuthService.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/application/service/auth/AuthService.java index ab12e54e..1c5f2fb6 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/application/service/auth/AuthService.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/application/service/auth/AuthService.java @@ -1,6 +1,7 @@ package com.gaebaljip.exceed.application.service.auth; import com.gaebaljip.exceed.adapter.out.redis.RedisAdapter; +import com.gaebaljip.exceed.common.dto.HttpRequestDTO; import com.gaebaljip.exceed.common.dto.ReissueTokenDTO; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; @@ -37,7 +38,7 @@ public LoginResponseDTO execute(LoginRequest request) { .accessToken(jwtManager.generateAccessToken(member.getId())) .refreshToken(jwtManager.generateRefreshToken(member.getId())) .build(); - jwtManager.saveRefreshToken(request.email(), loginResponseDTO.refreshToken()); + jwtManager.saveRefreshToken(member.getId().toString(), loginResponseDTO.refreshToken()); return loginResponseDTO; } } diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/domain/JwtManager.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/domain/JwtManager.java index a3d68659..af859ba0 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/domain/JwtManager.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/security/domain/JwtManager.java @@ -156,8 +156,8 @@ public boolean validateRefreshToken(String refreshToken, HttpRequestDTO requestD return false; } - public void saveRefreshToken(String email, String refreshToken) { - redisAdapter.saveWithExpiration(email, refreshToken, REFRESH_TOKEN_EXPIRE_TIME); + public void saveRefreshToken(String memberId, String refreshToken) { + redisAdapter.saveWithExpiration(memberId, refreshToken, REFRESH_TOKEN_EXPIRE_TIME); } public Claims parseClaims(String Token) {