Skip to content

Commit b44f5df

Browse files
committed
🚑 임시 리다이렉트 테스트
1 parent a759022 commit b44f5df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/boggle_boggle/bbegok/controller/OAuth2AuthController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.springframework.web.bind.annotation.*;
2121
import org.springframework.beans.factory.annotation.Value;
2222

23+
import java.io.IOException;
2324
import java.util.Map;
2425
import java.util.UUID;
2526

@@ -51,12 +52,14 @@ public DataResponseDto<OAuthLoginResponse> signup(@Valid @RequestBody SignupRequ
5152

5253
//리다이렉트할 인증서버URI를 리턴
5354
@GetMapping("/oauth2/authorize")
54-
public DataResponseDto<Map<String, String>> authorize(@RequestParam("provider") ProviderType providerType, HttpSession session) {
55+
public void authorize(@RequestParam("provider") ProviderType providerType, HttpSession session,
56+
HttpServletResponse response) throws IOException {
5557
String state = UUID.randomUUID().toString();
5658
session.setAttribute("oauth2_state", state);
5759

5860
String redirectUrl = oAuth2RedirectUriBuilder.buildRedirectUri(providerType, state);
59-
return DataResponseDto.of(Map.of("redirectUrl", redirectUrl));
61+
response.sendRedirect(redirectUrl); // 실제 리디렉션
62+
//return DataResponseDto.of(Map.of("redirectUrl", redirectUrl));
6063
}
6164

6265
//oauth 인증서버에서 인가코드를 리다이렉트(302)하는 콜백 API

0 commit comments

Comments
 (0)