PigxAuthenticationSuccessEventHandler.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2018-2025, lengleng All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the pig4cloud.com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: lengleng (wangiegie@gmail.com)
  16. */
  17. package com.pig4cloud.pigx.auth.handler;
  18. import com.pig4cloud.pigx.common.security.handler.AbstractAuthenticationSuccessEventHandler;
  19. import lombok.extern.slf4j.Slf4j;
  20. import org.springframework.security.core.Authentication;
  21. import org.springframework.stereotype.Component;
  22. /**
  23. * @author lengleng
  24. * @date 2018/10/8
  25. */
  26. @Slf4j
  27. @Component
  28. public class PigxAuthenticationSuccessEventHandler extends AbstractAuthenticationSuccessEventHandler {
  29. /**
  30. * 处理登录成功方法
  31. * <p>
  32. * 获取到登录的authentication 对象
  33. *
  34. * @param authentication 登录对象
  35. */
  36. @Override
  37. public void handle(Authentication authentication) {
  38. log.info("用户:{} 登录成功", authentication.getPrincipal());
  39. }
  40. }