Class CustomOAuth2SuccessHandler

java.lang.Object
com.mindstore.backend.controller.CustomOAuth2SuccessHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler

public class CustomOAuth2SuccessHandler extends Object implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
Custom Handler for Success Page when using OAuth - Google Authentication
  • Constructor Details

    • CustomOAuth2SuccessHandler

      public CustomOAuth2SuccessHandler(JwtService jwtService, AuthenticationService authService)
      custom success handler class
      Parameters:
      jwtService - for authenticating jwt token
      authService - service class for authentication actions
  • Method Details

    • onAuthenticationSuccess

      public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException
      Specified by:
      onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
      Parameters:
      request - - the request that was made
      response - - the extended response
      authentication - of the user
      Throws:
      IOException - for sendRedirect function: this controller is used to redirect the user after a oAuth login it redirects back to /