- Fixed a bug where given entity would failed it's loading with an error
This commit is contained in:
parent
70daae93f5
commit
0657622eab
|
@ -27,8 +27,13 @@ class Authenticate {
|
|||
public function rememberMe() : ? UserInterface
|
||||
{
|
||||
$logUser = function(? int $id) {
|
||||
if ( $id === null || null === ( $user = $this->user::repository()->loadFromPk($id) ) ) {
|
||||
throw new \InvalidArgumentException(sprintf("User having id '%s' was not found.", $id));
|
||||
try {
|
||||
if ($id === null || null === ($user = $this->user::repository()->loadFromPk($id))) {
|
||||
throw new \InvalidArgumentException(sprintf("User having id '%s' was not found.", $id));
|
||||
}
|
||||
}
|
||||
catch(\Exception $ex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->user->fromArray($user);
|
||||
|
|
|
@ -21,7 +21,7 @@ class PostRequestAuthenticationMiddleware implements MiddlewareInterface
|
|||
protected \Closure $loginFailedResponse,
|
||||
PostRequestAuthentication $authenticator = null,
|
||||
) {
|
||||
$this->authenticator = $authenticator ?: new PostRequestAuthentication(new Authenticate());
|
||||
$this->authenticator = $authenticator ?: new PostRequestAuthentication(new Authenticate($entity));
|
||||
}
|
||||
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
|
|
Loading…
Reference in New Issue