Skip to content

Commit

Permalink
fix: 리다이렉트 url 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
veronees committed Nov 26, 2024
1 parent 0891ef5 commit 823ce39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.Map;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -34,8 +33,7 @@ public class AuthController {
private final AuthService authService;
private final MemberService memberService;

@Value("${redirect.url}")
private String redirectBaseUrl;
private final static String LOGIN_SUCCESS_REDIRECT_URL = "https://ecomarket-cuk.netlify.app";

@Operation(
summary = "카카오 로그인 페이지로 리다이렉트 API",
Expand All @@ -59,9 +57,10 @@ public void callBack(
Map<String, String> memberInfo = authService.getMemberInfo(code);
LoginSuccessDto loginSuccessDto = memberService.login(memberInfo);

String redirectUrl = redirectBaseUrl + "?isFirstLogin=" + loginSuccessDto.getIsFirstLogin()
+ "&accessToken=" + loginSuccessDto.getTokenResponseDto().getAccessToken()
+ "&refreshToken=" + loginSuccessDto.getTokenResponseDto().getRefreshToken();
String redirectUrl =
LOGIN_SUCCESS_REDIRECT_URL + "?isFirstLogin=" + loginSuccessDto.getIsFirstLogin()
+ "&accessToken=" + loginSuccessDto.getTokenResponseDto().getAccessToken()
+ "&refreshToken=" + loginSuccessDto.getTokenResponseDto().getRefreshToken();

response.sendRedirect(redirectUrl);
}
Expand Down Expand Up @@ -102,6 +101,7 @@ public ResponseEntity<ApiResponse<String>> logout(@AuthenticationPrincipal Membe


private final JwtUtil jwtUtil;

@Deprecated
@GetMapping("/test/login")
public ResponseEntity<ApiResponse<String>> getTestAccessToken(@RequestParam String clientId) {
Expand Down
2 changes: 1 addition & 1 deletion submodule

0 comments on commit 823ce39

Please sign in to comment.