Skip to content

Commit

Permalink
Feat: redirect url 이전 설정으로 복구
Browse files Browse the repository at this point in the history
  • Loading branch information
nampongo committed Mar 15, 2024
1 parent 79543a7 commit ef1f45a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
TokenDto token = new TokenDto(tokenProvider.createAccessToken(userEmail),
tokenProvider.createRefreshToken(userEmail), member.getHasInfo());

Optional<Redis> optionalRedis = redisUtil.findByEmail(userEmail);
/*Optional<Redis> 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());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef1f45a

Please sign in to comment.