Skip to content

Commit ef0cdb3

Browse files
committed
[Security] fixed pre/post authentication checks
1 parent 0b6887e commit ef0cdb3

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

User/UserChecker.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,6 @@ public function checkPreAuth(UserInterface $user)
3232
return;
3333
}
3434

35-
if (!$user->isCredentialsNonExpired()) {
36-
$ex = new CredentialsExpiredException('User credentials have expired.');
37-
$ex->setUser($user);
38-
throw $ex;
39-
}
40-
}
41-
42-
/**
43-
* {@inheritdoc}
44-
*/
45-
public function checkPostAuth(UserInterface $user)
46-
{
47-
if (!$user instanceof AdvancedUserInterface) {
48-
return;
49-
}
50-
5135
if (!$user->isAccountNonLocked()) {
5236
$ex = new LockedException('User account is locked.');
5337
$ex->setUser($user);
@@ -66,4 +50,20 @@ public function checkPostAuth(UserInterface $user)
6650
throw $ex;
6751
}
6852
}
53+
54+
/**
55+
* {@inheritdoc}
56+
*/
57+
public function checkPostAuth(UserInterface $user)
58+
{
59+
if (!$user instanceof AdvancedUserInterface) {
60+
return;
61+
}
62+
63+
if (!$user->isCredentialsNonExpired()) {
64+
$ex = new CredentialsExpiredException('User credentials have expired.');
65+
$ex->setUser($user);
66+
throw $ex;
67+
}
68+
}
6969
}

0 commit comments

Comments
 (0)