Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ public function checkPreAuth(UserInterface $user): void
{
}

public function checkPostAuth(UserInterface $user): void
public function checkPostAuth(UserInterface $user, ?TokenInterface $token = null): void
{
}
}
Expand Down
11 changes: 5 additions & 6 deletions src/Symfony/Component/Security/Core/User/ChainUserChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ public function checkPreAuth(UserInterface $user): void
}
}

public function checkPostAuth(UserInterface $user /* , TokenInterface $token */): void
/**
* @param ?TokenInterface $token
*/
public function checkPostAuth(UserInterface $user /* , ?TokenInterface $token = null */): void
{
$token = 1 < \func_num_args() ? func_get_arg(1) : null;

foreach ($this->checkers as $checker) {
if ($token instanceof TokenInterface) {
$checker->checkPostAuth($user, $token);
} else {
$checker->checkPostAuth($user);
}
$checker->checkPostAuth($user, $token);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public function checkPreAuth(UserInterface $user): void
}
}

public function checkPostAuth(UserInterface $user): void
/**
* @param ?TokenInterface $token
*/
public function checkPostAuth(UserInterface $user /* , ?TokenInterface $token = null */): void
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Security\Core\User;

use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AccountStatusException;

/**
Expand All @@ -33,7 +34,9 @@ public function checkPreAuth(UserInterface $user): void;
/**
* Checks the user account after authentication.
*
* @param ?TokenInterface $token
*
* @throws AccountStatusException
*/
public function checkPostAuth(UserInterface $user /* , TokenInterface $token */): void;
public function checkPostAuth(UserInterface $user /* , ?TokenInterface $token = null */): void;
}