Skip to content

Commit

Permalink
refactor: redirect URI '/'으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Enble committed May 14, 2024
1 parent 65398e3 commit 69ca89a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@Slf4j
public class OAuth2SuccessHandler implements AuthenticationSuccessHandler {

private static final String REDIRECT_URL = "/auth/success";
private static final String REDIRECT_URL = "/";
private static final String CLIENT_DOMAIN = "https://www.agilehub.store";

private final RefreshTokenRedisService redisService;
Expand All @@ -39,8 +39,8 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
GeneratedToken generatedToken = generateMemberToken(authentication);

String redirectUrl = UriComponentsBuilder.fromUriString(REDIRECT_URL)
.queryParam("accessToken", generatedToken.getAccessToken())
.build().toUriString();
.queryParam("accessToken", generatedToken.getAccessToken())
.build().toUriString();

response.sendRedirect(CLIENT_DOMAIN + redirectUrl);
}
Expand All @@ -51,7 +51,7 @@ private GeneratedToken generateMemberToken(Authentication authentication) {
String distinctId = principal.getId();
String name = principal.getName();
String role = principal.getAuthorities().stream().findFirst()
.orElseThrow(() -> new GeneralException(ErrorStatus.MEMBER_ROLE_NOT_EXIST)).getAuthority();
.orElseThrow(() -> new GeneralException(ErrorStatus.MEMBER_ROLE_NOT_EXIST)).getAuthority();

GeneratedToken token = jwtUtil.generateToken(name, role, provider, distinctId);

Expand Down

0 comments on commit 69ca89a

Please sign in to comment.