mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Return user field when requestUser param received on authentication/refresh endpoint [deploy]
This commit is contained in:
@@ -28,10 +28,16 @@ class RefreshTokenForm extends ApiForm {
|
||||
*/
|
||||
public $clientToken;
|
||||
|
||||
/**
|
||||
* @var string|bool
|
||||
*/
|
||||
public $requestUser;
|
||||
|
||||
public function rules(): array {
|
||||
return [
|
||||
[['accessToken', 'clientToken'], RequiredValidator::class],
|
||||
[['accessToken'], AccessTokenValidator::class, 'verifyExpiration' => false],
|
||||
[['requestUser'], 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -83,7 +89,7 @@ class RefreshTokenForm extends ApiForm {
|
||||
$minecraftOauthSession->last_used_at = time();
|
||||
Assert::true($minecraftOauthSession->save());
|
||||
|
||||
return new AuthenticateData($account, (string)$token, $this->clientToken);
|
||||
return new AuthenticateData($account, (string)$token, $this->clientToken, (bool)$this->requestUser);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user