Skip to content

Commit

Permalink
[fix] 구글 로그인 response 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hysong4u committed Apr 18, 2024
1 parent 71ad72d commit 5e4bb40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ ResponseEntity<SuccessResponse<?>> googleLogin(@RequestParam (name = "code") Str
User user = userRepository.findById(userId).orElseThrow(() -> new EntityNotFoundException(ErrorCode.USER_NOT_FOUND));

String nickname = user.getNickname();
if (nickname == null) {
nickname = userService.generateNickname();
if (nickname == null) { //
nickname = UserService.generateNickname();
LoginResponseDto response = new LoginResponseDto(accessToken, nickname,true);
return SuccessResponse.ok(response);
}
else{
LoginResponseDto response = new LoginResponseDto(accessToken, nickname,false);
return SuccessResponse.ok(response);
}

LoginResponseDto response = new LoginResponseDto(accessToken, nickname);
return SuccessResponse.ok(response);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public record LoginResponseDto(
String accessToken,
String nickname
String nickname,
Boolean isNew
) {
}

0 comments on commit 5e4bb40

Please sign in to comment.