Skip to content

Commit

Permalink
NO-JIRA-refactor : response 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
born-A committed Nov 7, 2023
1 parent b478c14 commit ca5152d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.prgrms.nabimarketbe.domain.user.service.SignService;
import org.prgrms.nabimarketbe.global.util.ResponseFactory;
import org.prgrms.nabimarketbe.global.util.model.CommonResult;
import org.prgrms.nabimarketbe.global.util.model.SingleResult;
import org.prgrms.nabimarketbe.oauth2.kakao.dto.KakaoProfile;
import org.prgrms.nabimarketbe.oauth2.kakao.service.OAuth2Service;
import org.springframework.core.env.Environment;
Expand Down Expand Up @@ -39,11 +40,13 @@ public void socialLogin(HttpServletResponse response) throws IOException {
}

@GetMapping(value = "/redirect")
public UserLoginResponseDTO redirectKakao(@RequestParam String code) {
public ResponseEntity<SingleResult<UserLoginResponseDTO>> redirectKakao(@RequestParam String code) {
KakaoProfile profile = OAuth2Service.getResultProfile(code);
if (profile == null) throw new RuntimeException("카카오에 해당 회원이 없습니다.");
UserLoginResponseDTO userLoginResponseDTO = signService.signInBySocial(profile);
SingleResult<UserLoginResponseDTO> response = ResponseFactory.getSingleResult(userLoginResponseDTO);

return signService.signInBySocial(profile);
return ResponseEntity.ok(response);
}

//TODO : 사용자가 accessToken 넘기는건 아닌거 같음
Expand Down

0 comments on commit ca5152d

Please sign in to comment.