Skip to content

Commit

Permalink
fix(#5) : 탈퇴 후 재로그인 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
aeeazip committed Aug 21, 2023
1 parent bba8adf commit 9ff4e87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/trothly/trothcam/service/auth/OAuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,16 @@ public LoginResDto appleLogin(LoginReqDto loginReqDto) throws BaseException {

// refreshToken 만료 후 재로그인 or 탈퇴 후 재로그인
public LoginResDto reLogin(Member member) {
log.info("재로그인 하는 경우");

// accessToken, refreshToken 발급
String newAccessToken = jwtService.encodeJwtToken(new TokenDto(member.getId()));
String newRefreshToken = jwtService.encodeJwtRefreshToken(member.getId());

member.updateRefreshToken(newRefreshToken); // DB에 refreshToken 저장
member.updateStatus("active"); // inactive -> active로 변환 (탈퇴 후 재로그인만 해당)

memberRepository.save(member);
return new LoginResDto(newAccessToken, newRefreshToken);
}

Expand Down

0 comments on commit 9ff4e87

Please sign in to comment.