mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Исправлена обработка ситуации, когда uuid selectedProfile при join операции передан без дефисов
This commit is contained in:
@ -126,7 +126,7 @@ class JoinForm extends Model {
|
||||
|
||||
$selectedProfile = $this->selectedProfile;
|
||||
$isUuid = StringHelper::isUuid($selectedProfile);
|
||||
if ($isUuid && $account->uuid !== $selectedProfile) {
|
||||
if ($isUuid && $account->uuid !== $this->normalizeUUID($selectedProfile)) {
|
||||
Session::error(
|
||||
"User with access_token = '{$accessToken}' trying to join with identity = '{$selectedProfile}'," .
|
||||
" but access_token issued to account with id = '{$account->uuid}'."
|
||||
@ -149,4 +149,8 @@ class JoinForm extends Model {
|
||||
return $this->account;
|
||||
}
|
||||
|
||||
private function normalizeUUID(string $uuid): string {
|
||||
return Uuid::fromString($uuid)->toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user