Skip to content

Commit

Permalink
#128 feat: redirectUrl null 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
yonghwankim-dev committed Oct 2, 2023
1 parent 71bf293 commit 33b8e08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class OauthRestController {
public ApiResponse<OauthSignUpResponse> signUp(
@PathVariable String provider,
@RequestParam String code,
@RequestParam String redirectUrl,
@RequestParam(value = "redirectUrl", required = false) String redirectUrl,
@RequestPart(value = "profile", required = false) MultipartFile profile,
@Valid @RequestPart(value = "signupData") OauthSignUpRequest request) {
log.info("provider : {}, code : {}, requestUrl : {}, profile : {}, request : {}", provider, code, redirectUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public OauthAccessTokenResponse exchangeAccessTokenByAuthorizationCode(String au
@Override
public MultiValueMap<String, String> createFormData(String authorizationCode, String redirectUrl) {
MultiValueMap<String, String> formData = new LinkedMultiValueMap<>();
if (redirectUrl == null) {
redirectUrl = getRedirectUri();
}
formData.add("code", authorizationCode);
formData.add("client_id", getClientId());
formData.add("client_secret", getClientSecret());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public OauthAccessTokenResponse exchangeAccessTokenByAuthorizationCode(String au
@Override
public MultiValueMap<String, String> createFormData(String authorizationCode, String redirectUrl) {
MultiValueMap<String, String> formData = new LinkedMultiValueMap<>();
if (redirectUrl == null) {
redirectUrl = getRedirectUri();
}
formData.add("code", authorizationCode);
formData.add("redirect_uri", redirectUrl);
formData.add("grant_type", "authorization_code");
Expand Down

0 comments on commit 33b8e08

Please sign in to comment.