Final Class Yiisoft\User\Method\ApiAuth
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Implementation of the AuthenticatorInterface for authenticating users in the API clients.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| authenticate() | Yiisoft\ |
|
| challenge() | Yiisoft\ |
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $currentUser | Yiisoft\ |
|
public function __construct(private readonly CurrentUser $currentUser) {}
| public ?\ | ||
| $request | \ |
|
public function authenticate(ServerRequestInterface $request): ?IdentityInterface
{
if ($this->currentUser->isGuest()) {
return null;
}
return $this->currentUser->getIdentity();
}
| public \ | ||
| $response | \ |
|
public function challenge(ResponseInterface $response): ResponseInterface
{
return $response;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.