Skip to content

Commit

Permalink
[hotfix] Oauth2 배포환경 리디렉주소 변경
Browse files Browse the repository at this point in the history
Oauth2 배포환경 리디렉주소 변경
  • Loading branch information
liyusang1 committed Jan 28, 2024
1 parent bf77604 commit 5af581f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* @implNote 해당 클래스는 SimpleUrlAuthenticationSuccessHandler를 상속받은 OAuth 로그인 성공 후 로직을 처리 하는 클래스
* 로그인 성공 후 리디렉트 하게 설정 했습니다.
* 프론트 배포사이트 -> http://localhost:5173/auth/social
* https://tripcometrue.vercel.app
* 스프링 코드 내로 리디렉트 설정 하고 싶은 경우
* String redirectUrl = "/user/oauth-success?token="+token;
*/
Expand All @@ -38,7 +39,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
//한국어 인코딩 설정
String encodedName = URLEncoder.encode(name, StandardCharsets.UTF_8.toString());

String redirectUrl = "http://localhost:5173/auth/social?token=" + token
String redirectUrl = "https://tripcometrue.vercel.app/auth/social?token=" + token
+ "&email=" + email + "&name=" + encodedName;
getRedirectStrategy().sendRedirect(request, response, redirectUrl);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ spring:
- email
client-name: Naver
authorization-grant-type: authorization_code
redirect-uri: http://tripcometrue.site/login/oauth2/code/naver
redirect-uri: https://tripcometrue.site/login/oauth2/code/naver

kakao:
client-id: ${KAKAO_ID}
client-secret: ${KAKAO_KEY}
client-authentication-method: client_secret_post
redirect-uri: http://tripcometrue.site/login/oauth2/code/kakao
redirect-uri: https://tripcometrue.site/login/oauth2/code/kakao
authorization-grant-type: authorization_code
client-name: Kakao
scope:
Expand Down

0 comments on commit 5af581f

Please sign in to comment.