Skip to content

Commit 68a074c

Browse files
committed
Merge branch 'main' into develop
2 parents 7389dd9 + 9dfd688 commit 68a074c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

api/src/main/java/com/mbtips/user/controller/ApiLoginController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ApiLoginController {
4141

4242
@GetMapping("/authorize-url")
4343
@Operation(summary = "카카오 로그인 인증 URL", description = "카카오 로그인 인증 URL 반환")
44-
public ApiResponse<String> getKakaoLoginUrl(@Parameter String redirectUrl) {
44+
public ApiResponse<String> getKakaoLoginUrl(@Parameter @RequestParam(required = false) String redirectUrl) {
4545
if (redirectUrl == null) {
4646
redirectUrl = kakaoProperties.redirectUrl();
4747
}
@@ -51,9 +51,14 @@ public ApiResponse<String> getKakaoLoginUrl(@Parameter String redirectUrl) {
5151

5252
@GetMapping("/login")
5353
@Operation(summary = "카카오 로그인 콜백 API(토큰 반환)", description = "카카오 로그인 및 회원 가입")
54-
public ApiResponse<String> kakaoLoginCallback(@RequestParam("code") String code) {
54+
public ApiResponse<String> kakaoLoginCallback(@RequestParam("code") String code,
55+
@Parameter @RequestParam(required = false) String redirectUrl
56+
) {
5557

56-
GetKakaoTokenRequestDto kakaoTokenRequestDto = new GetKakaoTokenRequestDto(AUTHORIZATION_CODE, kakaoProperties.appKey(), kakaoProperties.redirectUrl(), code);
58+
if (redirectUrl == null) {
59+
redirectUrl = kakaoProperties.redirectUrl();
60+
}
61+
GetKakaoTokenRequestDto kakaoTokenRequestDto = new GetKakaoTokenRequestDto(AUTHORIZATION_CODE, kakaoProperties.appKey(), redirectUrl, code);
5762
GetKakaoTokenResponseDto kakaoTokenResponseDto = kakaoAuthFeignClient.getAuthToken(kakaoTokenRequestDto.toMap());
5863

5964
String authorization = BEARER + kakaoTokenResponseDto.accessToken();

0 commit comments

Comments
 (0)