mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Covered all cases, fixed CS, added a new TODO
This commit is contained in:
@ -62,14 +62,10 @@ class RefreshTokenForm extends ApiForm {
|
||||
$account = Account::findOne(['id' => $tokenReader->getAccountId()]);
|
||||
}
|
||||
|
||||
if ($account === null || $account->status === Account::STATUS_DELETED) {
|
||||
if ($account === null) {
|
||||
throw new ForbiddenOperationException('Invalid token.');
|
||||
}
|
||||
|
||||
if ($account->status === Account::STATUS_BANNED) {
|
||||
throw new ForbiddenOperationException('This account has been suspended.');
|
||||
}
|
||||
|
||||
$token = Yii::$app->tokensFactory->createForMinecraftAccount($account, $this->clientToken);
|
||||
|
||||
// TODO: This behavior duplicates with the AuthenticationForm. Need to find a way to avoid duplication.
|
||||
|
Reference in New Issue
Block a user