Skip to content

Commit 4072102

Browse files
authored
Merge pull request #216 from TwoSSome/update/oauth
refactor(oauth): oauth2 리다이렉트 url 변경
2 parents ebace63 + 99e768a commit 4072102

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/towssome/server/oauth2/CustomSuccessHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
1414
import org.springframework.stereotype.Component;
1515
import towssome.server.advice.RoleAdvice;
16+
import towssome.server.advice.URLAdvice;
1617
import towssome.server.entity.Member;
1718
import towssome.server.entity.RefreshToken;
1819
import towssome.server.jwt.JwtUtil;
@@ -68,9 +69,9 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
6869
String redirectUrl = null;
6970

7071
if (role.equals(RoleAdvice.ROLE_TEMP)) { // 처음 로그인 했을 때
71-
redirectUrl = localURL + tempURL; // 초기 설정 페이지로 리다이렉트
72+
redirectUrl = URLAdvice.SERVER_IP + "/" + tempURL; // 초기 설정 페이지로 리다이렉트
7273
} else { // 처음 로그인이 아닐 때
73-
redirectUrl = localURL + userURL;
74+
redirectUrl = URLAdvice.SERVER_IP + "/" + userURL;
7475
}
7576
String redirectUrlWithToken = String.format("%s?token=%s", redirectUrl, token); // jwt 토큰 포함
7677
response.sendRedirect(redirectUrlWithToken);

0 commit comments

Comments
 (0)