Skip to content

Commit 0ce3420

Browse files
committed
Polish "Publish an AuditEvent on logout"
See gh-41278
1 parent c5953fe commit 0ce3420

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/security/AuthenticationAuditListener.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList
5353
public static final String AUTHENTICATION_SWITCH = "AUTHENTICATION_SWITCH";
5454

5555
/**
56-
* This constant is used to indicate that the logout process
57-
* has been completed successfully.
56+
* Logout success event type.
5857
*
5958
* @since 3.4.0
6059
*/
@@ -111,7 +110,6 @@ private void onLogoutSuccessEvent(LogoutSuccessEvent event) {
111110
data.put("details", event.getAuthentication().getDetails());
112111
}
113112
publish(new AuditEvent(event.getAuthentication().getName(), LOGOUT_SUCCESS, data));
114-
115113
}
116114

117115
private static final class WebAuditListener {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthenticationAuditListenerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void testAuthenticationSuccess() {
6262
}
6363

6464
@Test
65-
void testLogoutSucess() {
65+
void testLogoutSuccess() {
6666
AuditApplicationEvent event = handleAuthenticationEvent(
6767
new LogoutSuccessEvent(new UsernamePasswordAuthenticationToken("user", "password")));
6868
assertThat(event.getAuditEvent().getType()).isEqualTo(AuthenticationAuditListener.LOGOUT_SUCCESS);

0 commit comments

Comments
 (0)