Skip to content

Commit

Permalink
refactor: orgin 성공시 redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoya324 committed Nov 29, 2024
1 parent 34204a3 commit 1744192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
CookieUtil.addCookie(response, ACCESS_TOKEN, accessToken.getToken(), cookieMaxAge);
response.setHeader(accessHeader, BEARER + accessToken.getToken());

// clearAuthenticationAttributes(request, response);
// getRedirectStrategy().sendRedirect(request, response, targetUrl);
clearAuthenticationAttributes(request, response);
if (request.getRequestURI().contains("http://localhost:5173")) {
getRedirectStrategy().sendRedirect(request, response, "http://localhost:5173/map");
} else {
getRedirectStrategy().sendRedirect(request, response, "https://findynow.com/map");
}
}

protected String determineTargetUrl(HttpServletRequest request, HttpServletResponse response,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest
}

public void removeAuthorizationRequestCookies(HttpServletRequest request, HttpServletResponse response) {
CookieUtil.deleteCookie(request, response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME);
CookieUtil.deleteCookie(request, response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME);
CookieUtil.deleteCookie(request, response, REDIRECT_URI_PARAM_COOKIE_NAME);
CookieUtil.deleteCookie(request, response, REFRESH_TOKEN);
CookieUtil.deleteCookie(request, response, ACCESS_TOKEN);
}
}

0 comments on commit 1744192

Please sign in to comment.