diff --git a/src/main/java/com/wl2c/elswhereuserservice/domain/oauth/apple/service/AppleOAuth2Service.java b/src/main/java/com/wl2c/elswhereuserservice/domain/oauth/apple/service/AppleOAuth2Service.java index 1940bad..75dcd7d 100644 --- a/src/main/java/com/wl2c/elswhereuserservice/domain/oauth/apple/service/AppleOAuth2Service.java +++ b/src/main/java/com/wl2c/elswhereuserservice/domain/oauth/apple/service/AppleOAuth2Service.java @@ -81,6 +81,13 @@ public ResponseEntity handleAppleOAuthCallback(Map params, Ht } // Apple OAuth 서비스로부터 액세스 토큰을 가져옴 Map tokenResponse = getTokens(params, response); + if (tokenResponse.containsKey("error")) { + String error = tokenResponse.get("error"); + String redirectUrl = builder.queryParam("error", error).build().toUriString(); + HttpHeaders headers = new HttpHeaders(); + headers.add("Location", redirectUrl); + return new ResponseEntity<>(headers, HttpStatus.SEE_OTHER); + } String accessToken = tokenResponse.get("access_token"); String refreshToken = tokenResponse.get("refresh_token");