Skip to content

Commit

Permalink
Merge pull request #22 from Team-Going/feature/19
Browse files Browse the repository at this point in the history
[feat] 회원 탈퇴 API 구현
  • Loading branch information
gardening-y authored Jan 7, 2024
2 parents 0d66e26 + a75c8b8 commit 84e8ce7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ public ResponseEntity<ApiResponse<?>> signOut(@UserId final Long userId) {
userService.signOut(userId);
return ApiResponseUtil.success(SuccessMessage.OK);
}

@DeleteMapping("/withdraw")
public ResponseEntity<ApiResponse<?>> withdraw(@UserId final Long userId) {
userService.withdraw(userId);
return ApiResponseUtil.success(SuccessMessage.OK);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public void signOut(Long userId) {
deleteRefreshToken(findUser);
}

public void withdraw(Long userId) {
userRepository.deleteById(userId);
}

private String getPlatformId(String token, Platform platform) {
if (platform == APPLE) {
return appleOAuthProvider.getApplePlatformId(token);
Expand Down Expand Up @@ -88,5 +92,4 @@ private void deleteRefreshToken(User user) {
user.updateRefreshToken(null);
refreshTokenRepository.deleteById(user.getId());
}

}

0 comments on commit 84e8ce7

Please sign in to comment.