Skip to content

Commit

Permalink
Merge pull request #188 from Troth-Cam/feat/apple-login
Browse files Browse the repository at this point in the history
fix(#5) : 탈퇴 후 재로그인 수정
  • Loading branch information
aeeazip authored Aug 21, 2023
2 parents 04fe587 + 9ff4e87 commit a722748
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 a722748

Please sign in to comment.