- Moved Authenticate to DI file def
This commit is contained in:
1 parent
23079e6040
commit
d149e0a741
5 files changed
+22
-8
No files matched your search
@@ -5,11 +5,13 @@ namespace Ulmus\User\Authorize\Header;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Ulmus\User\Entity\BasicAuthUserInterface;
|
||||
use Ulmus\User\Entity\UserInterface;
|
||||
use Ulmus\User\Lib\Authenticate;
|
||||
use Ulmus\User\Lib\Authorize;
|
||||
|
||||
class BasicMethod implements MethodInterface
|
||||
{
|
||||
public function __construct(
|
||||
protected Authenticate $authorize,
|
||||
protected BasicAuthUserInterface $user,
|
||||
protected string|array $arguments
|
||||
) {}
|
||||
@@ -29,7 +31,8 @@ class BasicMethod implements MethodInterface
|
||||
throw new \RuntimeException("A password must be provided");
|
||||
}
|
||||
|
||||
( new Authorize($this->user) )->authenticate([ $this->user->usernameField() => $userName ], $password);
|
||||
$this->authorize->user = $this->user;
|
||||
$this->authorize->authenticate([ $this->user->usernameField() => $userName ], $password);
|
||||
|
||||
return $this->user->loggedIn();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user