- Work done to support Basic / Bearer / Digest method

This commit is contained in:
Dave Mc Nicoll committed 2023-11-13 14:23:24 -05:00
1 parent 0f2886b266
commit 9570320a3b
8 files changed
+33 -11

No files matched your search

+4 -3
View File
@@ -3,13 +3,14 @@
namespace Ulmus\User\Authorize\Header;
use Psr\Http\Message\ServerRequestInterface;
use Ulmus\User\Entity\BasicAuthUserInterface;
use Ulmus\User\Entity\UserInterface;
use Ulmus\User\Lib\Authorize;
class BasicMethod
class BasicMethod implements MethodInterface
{
public function __construct(
protected UserInterface $user,
protected BasicAuthUserInterface $user,
protected string|array $arguments
) {}
@@ -28,7 +29,7 @@ class BasicMethod
throw new \RuntimeException("A password must be provided");
}
( new Authorize($this->user) )->authenticate([ 'email' => $userName, 'username' => $userName ], $password);
( new Authorize($this->user) )->authenticate([ $this->user->usernameField() => $userName ], $password);
return $this->user->loggedIn();
}