Skip to content

Commit

Permalink
fix(api) : oauth call back url 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ImNM committed Jan 15, 2023
1 parent fcabb33 commit 4a68bbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public OauthLoginLinkResponse getKakaoOauthLink(
log.info("/oauth/kakao" + host);
String format = String.format("https://%s/", host);
if (referer.contains("admin")) {
// 프론트 개발자가 로컬에서 개발 테스트 할 때 해당 https://두둥.com/admin
return registerUseCase.getKaKaoOauthLink(format + "/admin");
// 프론트 개발자가 로컬에서 개발 테스트 할 때 해당 https://두둥.com/admin/
return registerUseCase.getKaKaoOauthLink(format + "admin");
}
return registerUseCase.getKaKaoOauthLink(format);
} else if (referer.contains("5173")) {
// 프론트 개발자가 로컬에서 개발 테스트 할 때 해당 https://localhost:5173/
return registerUseCase.getKaKaoOauthLink(referer + "/admin");
// 프론트 개발자가 로컬에서 개발 테스트 할 때 해당 https://localhost:5173/admin/
return registerUseCase.getKaKaoOauthLink(referer + "admin");
}
// 프론트 개발자가 로컬에서 개발 테스트 할 때 해당 https://localhost:3000/
return registerUseCase.getKaKaoOauthLink(referer);
Expand All @@ -93,11 +93,11 @@ public OauthTokenResponse getCredentialFromKaKao(
log.info("/oauth/kakao" + host);
String format = String.format("https://%s/", host);
if (referer.contains("admin")) {
return registerUseCase.getCredentialFromKaKao(code, format + "/admin");
return registerUseCase.getCredentialFromKaKao(code, format + "admin");
}
return registerUseCase.getCredentialFromKaKao(code, format);
} else if (referer.contains("5173")) {
return registerUseCase.getCredentialFromKaKao(code, referer + "/admin");
return registerUseCase.getCredentialFromKaKao(code, referer + "admin");
}
return registerUseCase.getCredentialFromKaKao(code, referer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public String getKaKaoOauthLink(String referer) {
+ String.format(
KAKAO_OAUTH_QUERY_STRING,
oauthProperties.getKakaoClientId(),
referer + "kakao/callback");
referer + "/kakao/callback");
}

public KakaoTokenResponse getOauthToken(String code, String referer) {

return kakaoOauthClient.kakaoAuth(
oauthProperties.getKakaoClientId(),
referer + "kakao/callback",
referer + "/kakao/callback",
code,
oauthProperties.getKakaoClientSecret());
}
Expand Down

0 comments on commit 4a68bbe

Please sign in to comment.