Class SecurityLogoutSuccessHandler

java.lang.Object
com.codeupsoft.component.security.handler.SecurityLogoutSuccessHandler
All Implemented Interfaces:
Serializable, org.springframework.security.web.authentication.logout.LogoutSuccessHandler

public class SecurityLogoutSuccessHandler extends Object implements org.springframework.security.web.authentication.logout.LogoutSuccessHandler, Serializable
退出登录成功处理器.

当用户成功登出时,清理用户会话信息并返回成功响应. 将成功信息以JSON格式返回给客户端.

Author:
Liu,Dongdong
See Also:
  • Constructor Details

    • SecurityLogoutSuccessHandler

      public SecurityLogoutSuccessHandler()
  • Method Details

    • onLogoutSuccess

      public void onLogoutSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException
      处理登出成功事件.

      调用认证服务清理用户会话,并返回成功响应.

      Specified by:
      onLogoutSuccess in interface org.springframework.security.web.authentication.logout.LogoutSuccessHandler
      Parameters:
      request - HTTP请求对象,可以为 null
      response - HTTP响应对象
      authentication - 认证信息
      Throws:
      IOException - IO异常