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:
@ -34,10 +34,16 @@ class AuthenticationForm extends ApiForm {
|
||||
*/
|
||||
public $clientToken;
|
||||
|
||||
/**
|
||||
* @var string|bool
|
||||
*/
|
||||
public $requestUser;
|
||||
|
||||
public function rules(): array {
|
||||
return [
|
||||
[['username', 'password', 'clientToken'], RequiredValidator::class],
|
||||
[['clientToken'], ClientTokenValidator::class],
|
||||
[['requestUser'], 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -85,7 +91,7 @@ class AuthenticationForm extends ApiForm {
|
||||
/** @var Account $account */
|
||||
$account = $loginForm->getAccount();
|
||||
$token = Yii::$app->tokensFactory->createForMinecraftAccount($account, $this->clientToken);
|
||||
$dataModel = new AuthenticateData($account, (string)$token, $this->clientToken);
|
||||
$dataModel = new AuthenticateData($account, (string)$token, $this->clientToken, (bool)$this->requestUser);
|
||||
/** @var OauthSession|null $minecraftOauthSession */
|
||||
$minecraftOauthSession = $account->getOauthSessions()
|
||||
->andWhere(['client_id' => OauthClient::UNAUTHORIZED_MINECRAFT_GAME_LAUNCHER])
|
||||
|
Reference in New Issue
Block a user