Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -19,6 +20,12 @@
@Tag(name = "Social OAuth API", description = "소셜 로그인 관련 API (카카오)")
public class OAuthController {

@Value("${custom.oauth2.kakao.redirect.new-user}")
private String newUserRedirectUrl;

@Value("${custom.oauth2.kakao.redirect.existing-user}")
private String existingUserRedirectUrl;

private final OauthService oauthService;

@Operation(summary = "카카오 소셜 로그인 API")
Expand All @@ -37,8 +44,8 @@ public void kakaoLogin(@RequestParam(value = "code", required = false) String co
ResultResponse<?> resultResponse = oauthService.kakaoLogin(accessToken, response);
ParentLoginResponseDto dto = (ParentLoginResponseDto) resultResponse.getData();
String redirectUrl = dto.isNewUser()
? "https://localhost:3000/join/parent/1"
: "https://localhost:3000";
? newUserRedirectUrl
: existingUserRedirectUrl;
response.sendRedirect(redirectUrl);
} catch (BusinessException e) {
try {
Expand Down