From ef1f45a067606f9b50e8991f4b9a1bdd6dc30791 Mon Sep 17 00:00:00 2001 From: sdw504512 Date: Fri, 15 Mar 2024 17:47:02 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20redirect=20url=20=EC=9D=B4=EC=A0=84=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=EC=9C=BC=EB=A1=9C=20=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/senity/waved/base/config/WebSecurityConfig.java | 3 +-- .../waved/base/security/OAuth2MemberSuccessHandler.java | 4 ++-- src/main/resources/application.yml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/senity/waved/base/config/WebSecurityConfig.java b/src/main/java/com/senity/waved/base/config/WebSecurityConfig.java index b7deda9..fb93ef4 100644 --- a/src/main/java/com/senity/waved/base/config/WebSecurityConfig.java +++ b/src/main/java/com/senity/waved/base/config/WebSecurityConfig.java @@ -52,8 +52,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti .baseUri("/oauth2/authorization") ) .redirectionEndpoint(redirection -> redirection - .baseUri("/.auth/login/google/**") - //.baseUri("/login/oauth2/code/**") + .baseUri("/login/oauth2/code/**") ) .userInfoEndpoint(userInfo -> userInfo.userService(customOAuth2UserService)) .successHandler(oAuth2AuthenticationSuccessHandler) diff --git a/src/main/java/com/senity/waved/base/security/OAuth2MemberSuccessHandler.java b/src/main/java/com/senity/waved/base/security/OAuth2MemberSuccessHandler.java index 5515dc5..7f2c287 100644 --- a/src/main/java/com/senity/waved/base/security/OAuth2MemberSuccessHandler.java +++ b/src/main/java/com/senity/waved/base/security/OAuth2MemberSuccessHandler.java @@ -40,11 +40,11 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo TokenDto token = new TokenDto(tokenProvider.createAccessToken(userEmail), tokenProvider.createRefreshToken(userEmail), member.getHasInfo()); - Optional optionalRedis = redisUtil.findByEmail(userEmail); + /*Optional optionalRedis = redisUtil.findByEmail(userEmail); if (optionalRedis.isPresent()) { redisUtil.deleteByEmail(userEmail); } - redisUtil.save(userEmail, token.getRefreshToken()); + redisUtil.save(userEmail, token.getRefreshToken());*/ log.info("info log={}", userEmail + token.getRefreshToken()); response.setHeader("Authorization", "Bearer " + token.getAccessToken()); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 34bdf8c..f83d686 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -44,7 +44,7 @@ spring: registration: google: client-name: Google - #redirect-uri: '${custom.site.baseUrl}/.auth/login/google/callback' + redirect-uri: '${custom.site.baseUrl}/login/oauth2/code/google' scope: - email - profile