mirror of
https://github.com/elyby/accounts.git
synced 2024-12-25 22:59:53 +05:30
Исправлена обработка ситуации, когда при использовании старого протокола авторизации на сервере пользователь передавал свой ник в неправильном регистре
This commit is contained in:
parent
b8e445b99f
commit
6d4d2177d0
@ -134,7 +134,7 @@ class JoinForm extends Model {
|
|||||||
throw new ForbiddenOperationException('Wrong selected_profile.');
|
throw new ForbiddenOperationException('Wrong selected_profile.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$isUuid && $account->username !== $selectedProfile) {
|
if (!$isUuid && mb_strtolower($account->username) !== mb_strtolower($selectedProfile)) {
|
||||||
Session::error(
|
Session::error(
|
||||||
"User with access_token = '{$accessToken}' trying to join with identity = '{$selectedProfile}'," .
|
"User with access_token = '{$accessToken}' trying to join with identity = '{$selectedProfile}'," .
|
||||||
" but access_token issued to account with username = '{$account->username}'."
|
" but access_token issued to account with username = '{$account->username}'."
|
||||||
|
@ -30,6 +30,17 @@ class JoinLegacyCest {
|
|||||||
$this->expectSuccessResponse($I);
|
$this->expectSuccessResponse($I);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function joinByOauth2TokenAndDifferentLetterCase(AuthserverSteps $I) {
|
||||||
|
$I->wantTo('join to server by legacy protocol, using legacy authserver access token and different letter case');
|
||||||
|
[$accessToken] = $I->amAuthenticated();
|
||||||
|
$this->route->joinLegacy([
|
||||||
|
'sessionId' => $accessToken,
|
||||||
|
'user' => 'admin',
|
||||||
|
'serverId' => Uuid::uuid(),
|
||||||
|
]);
|
||||||
|
$this->expectSuccessResponse($I);
|
||||||
|
}
|
||||||
|
|
||||||
public function joinByNewSessionFormat(AuthserverSteps $I) {
|
public function joinByNewSessionFormat(AuthserverSteps $I) {
|
||||||
$I->wantTo('join to server by legacy protocol with new launcher session format, using legacy authserver');
|
$I->wantTo('join to server by legacy protocol with new launcher session format, using legacy authserver');
|
||||||
[$accessToken] = $I->amAuthenticated();
|
[$accessToken] = $I->amAuthenticated();
|
||||||
|
Loading…
Reference in New Issue
Block a user