source: src/main/java/com/tourMate/config/oauth2/CustomOAuth2SuccessHandler.java@ 0f5aa27

Last change on this file since 0f5aa27 was 0f5aa27, checked in by darsov2 <62809499+darsov2@…>, 8 months ago

ouath, mailing impl

  • Property mode set to 100644
File size: 914 bytes
Line 
1package com.tourMate.config.oauth2;
2
3import jakarta.servlet.ServletException;
4import jakarta.servlet.http.HttpServletRequest;
5import jakarta.servlet.http.HttpServletResponse;
6import org.springframework.security.core.Authentication;
7import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
8import org.springframework.stereotype.Component;
9
10import java.io.IOException;
11
12@Component
13public class CustomOAuth2SuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
14 @Override
15 public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
16// OAuth2UserDetailsCustom oAuth2UserDetailsCustom = (OAuth2UserDetailsCustom) authentication.getPrincipal();
17 getRedirectStrategy().sendRedirect(request, response, "http://localhost:3000/login-callback");
18 }
19}
Note: See TracBrowser for help on using the repository browser.