mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Polish "Publish an AuditEvent on logout"
See gh-41278
This commit is contained in:
parent
c5953feae6
commit
0ce3420fcb
@ -53,8 +53,7 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList
|
||||
public static final String AUTHENTICATION_SWITCH = "AUTHENTICATION_SWITCH";
|
||||
|
||||
/**
|
||||
* This constant is used to indicate that the logout process
|
||||
* has been completed successfully.
|
||||
* Logout success event type.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
@ -111,7 +110,6 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList
|
||||
data.put("details", event.getAuthentication().getDetails());
|
||||
}
|
||||
publish(new AuditEvent(event.getAuthentication().getName(), LOGOUT_SUCCESS, data));
|
||||
|
||||
}
|
||||
|
||||
private static final class WebAuditListener {
|
||||
|
@ -62,7 +62,7 @@ class AuthenticationAuditListenerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLogoutSucess() {
|
||||
void testLogoutSuccess() {
|
||||
AuditApplicationEvent event = handleAuthenticationEvent(
|
||||
new LogoutSuccessEvent(new UsernamePasswordAuthenticationToken("user", "password")));
|
||||
assertThat(event.getAuditEvent().getType()).isEqualTo(AuthenticationAuditListener.LOGOUT_SUCCESS);
|
||||
|
Loading…
Reference in New Issue
Block a user