mirror of
https://github.com/elyby/accounts.git
synced 2024-11-27 01:02:06 +05:30
Исправлено поведение hasJoined операции для legacy протокола
This commit is contained in:
parent
014380c82b
commit
d262e577a6
@ -89,15 +89,12 @@ class SessionController extends ApiController {
|
|||||||
$hasJoinedForm = new HasJoinedForm($protocol);
|
$hasJoinedForm = new HasJoinedForm($protocol);
|
||||||
try {
|
try {
|
||||||
$hasJoinedForm->hasJoined();
|
$hasJoinedForm->hasJoined();
|
||||||
|
} catch (ForbiddenOperationException $e) {
|
||||||
|
return 'NO';
|
||||||
} catch (SessionServerException $e) {
|
} catch (SessionServerException $e) {
|
||||||
Yii::$app->response->statusCode = $e->statusCode;
|
Yii::$app->response->statusCode = $e->statusCode;
|
||||||
if ($e instanceof ForbiddenOperationException) {
|
|
||||||
$message = 'NO';
|
|
||||||
} else {
|
|
||||||
$message = $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $message;
|
return $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'YES';
|
return 'YES';
|
||||||
|
@ -44,7 +44,7 @@ class HasJoinedLegacyCest {
|
|||||||
'user' => 'random-username',
|
'user' => 'random-username',
|
||||||
'serverId' => Uuid::uuid(),
|
'serverId' => Uuid::uuid(),
|
||||||
]);
|
]);
|
||||||
$I->seeResponseCodeIs(401);
|
$I->seeResponseCodeIs(200);
|
||||||
$I->canSeeResponseEquals('NO');
|
$I->canSeeResponseEquals('NO');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user