From 69ca89af56fe75cfab22d9a388d6d270c05614d0 Mon Sep 17 00:00:00 2001 From: Enble Date: Tue, 14 May 2024 14:24:20 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20redirect=20URI=20'/'=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agilehub/global/auth/filter/OAuth2SuccessHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/dynamicquad/agilehub/global/auth/filter/OAuth2SuccessHandler.java b/src/main/java/dynamicquad/agilehub/global/auth/filter/OAuth2SuccessHandler.java index a19943c..da7da72 100644 --- a/src/main/java/dynamicquad/agilehub/global/auth/filter/OAuth2SuccessHandler.java +++ b/src/main/java/dynamicquad/agilehub/global/auth/filter/OAuth2SuccessHandler.java @@ -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; @@ -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); } @@ -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);