Last change
on this file was 0f5aa27, checked in by darsov2 <62809499+darsov2@…>, 8 months ago |
ouath, mailing impl
|
-
Property mode
set to
100644
|
File size:
914 bytes
|
Line | |
---|
1 | package com.tourMate.config.oauth2;
|
---|
2 |
|
---|
3 | import jakarta.servlet.ServletException;
|
---|
4 | import jakarta.servlet.http.HttpServletRequest;
|
---|
5 | import jakarta.servlet.http.HttpServletResponse;
|
---|
6 | import org.springframework.security.core.Authentication;
|
---|
7 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
|
---|
8 | import org.springframework.stereotype.Component;
|
---|
9 |
|
---|
10 | import java.io.IOException;
|
---|
11 |
|
---|
12 | @Component
|
---|
13 | public 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.