Skip to content

Commit b07b87a

Browse files
committed
♻️ OAuth2 응답 포맷 통일 및 Apple 콜백 파라미터 수정
- 리다이렉트 URI 반환 컨트롤러의 응답 구조를 기존 표준 응답 포맷과 통일 - Apple 인증 콜백에서 필수 파라미터 변경 사항 반영 ref: #145
1 parent 4bf70af commit b07b87a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public class OAuth2AuthController {
3333
private final OAuth2RedirectUriBuilder oAuth2RedirectUriBuilder;
3434

3535
@GetMapping("/authorize")
36-
public Map<String, String> authorize(@RequestParam("provider") ProviderType providerType, HttpSession session) {
36+
public DataResponseDto<Map<String, String>> authorize(@RequestParam("provider") ProviderType providerType, HttpSession session) {
3737
String state = UUID.randomUUID().toString();
3838
session.setAttribute("oauth2_state", state);
3939

4040
String redirectUrl = oAuth2RedirectUriBuilder.buildRedirectUri(providerType, state);
41-
return Map.of("redirectUrl", redirectUrl);
41+
return DataResponseDto.of(Map.of("redirectUrl", redirectUrl));
4242
}
4343

4444
//oauth 인증서버에서 인가코드를 리다이렉트(302)하는 콜백 API
@@ -61,8 +61,8 @@ public DataResponseDto<OAuthLoginResponse> oauth2Callback(
6161
//APPLE(POST) 전용 콜백 API
6262
@PostMapping("/callback/apple")
6363
public DataResponseDto<OAuthLoginResponse> oauth2AppkeCallback(
64-
@RequestParam("code") String code,
65-
@RequestParam(name="state", required = false) String state,
64+
@RequestParam(name = "code", required = false) String code,
65+
@RequestParam(name = "state", required = false) String state,
6666
HttpServletRequest request,
6767
HttpServletResponse response) {
6868
OauthValidateUtil.validateState(request, state);

0 commit comments

Comments
 (0)