Skip to content

Commit

Permalink
fix: 헤더 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
EUNCHAEv1006 committed Jan 23, 2024
1 parent 9d2ef04 commit d402b33
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ public ResponseEntity<CommonResponse<UserCategoryResponseDTO>> setCategory(
}

@GetMapping("/kakao/callback")
public String kakaoLogin(@RequestParam String code, HttpServletResponse response) throws JsonProcessingException {
public ResponseEntity<CommonResponse<String>> kakaoLogin(@RequestParam String code, HttpServletResponse response)
throws JsonProcessingException {

// jwt 토큰 반환
String token = kaKaoService.kakaoLogin(code);

response.setHeader(JwtUtil.AUTHORIZATION_HEADER, JwtUtil.BEARER_PREFIX + token);
response.setHeader(JwtUtil.AUTHORIZATION_HEADER, JwtUtil.BEARER_PREFIX + token.substring(7));

return "redirect:https://hhive.store/";
return ResponseEntity.ok()
.body(CommonResponse.of(HttpStatus.CREATED.value(), "카카오 로그인 성공", token));
}
}

0 comments on commit d402b33

Please sign in to comment.