mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Implementation of the backend for the OAuth2 clients management
This commit is contained in:
30
api/modules/oauth/models/IdentityInfo.php
Normal file
30
api/modules/oauth/models/IdentityInfo.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace api\modules\oauth\models;
|
||||
|
||||
use api\models\base\BaseAccountForm;
|
||||
use api\modules\accounts\models\AccountInfo;
|
||||
use common\models\Account;
|
||||
|
||||
class IdentityInfo extends BaseAccountForm {
|
||||
|
||||
private $model;
|
||||
|
||||
public function __construct(Account $account, array $config = []) {
|
||||
parent::__construct($account, $config);
|
||||
$this->model = new AccountInfo($account);
|
||||
}
|
||||
|
||||
public function info(): array {
|
||||
$response = $this->model->info();
|
||||
|
||||
$response['profileLink'] = $response['elyProfileLink'];
|
||||
unset($response['elyProfileLink']);
|
||||
$response['preferredLanguage'] = $response['lang'];
|
||||
unset($response['lang']);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user