mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Implemented device code grant
This commit is contained in:
@@ -3,6 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace common\components\OAuth2\Entities;
|
||||
|
||||
use common\models\OauthClient;
|
||||
use League\OAuth2\Server\Entities\ClientEntityInterface;
|
||||
use League\OAuth2\Server\Entities\Traits\ClientTrait;
|
||||
use League\OAuth2\Server\Entities\Traits\EntityTrait;
|
||||
@@ -26,6 +27,15 @@ final class ClientEntity implements ClientEntityInterface {
|
||||
$this->redirectUri = $redirectUri;
|
||||
}
|
||||
|
||||
public static function fromModel(OauthClient $model): self {
|
||||
return new self(
|
||||
$model->id, // @phpstan-ignore argument.type
|
||||
$model->name,
|
||||
$model->redirect_uri ?: '',
|
||||
(bool)$model->is_trusted,
|
||||
);
|
||||
}
|
||||
|
||||
public function isConfidential(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user