fix: Use case insensitive check when validating login name

Signed-off-by: Cleopatra Enjeck M. <patrathewhiz@gmail.com>
pull/51251/head
Cleopatra Enjeck M. 2025-02-24 06:17:00 +07:00 committed by backportbot[bot]
parent ea24143154
commit 449676be7c
1 changed files with 1 additions and 1 deletions

@ -780,7 +780,7 @@ class Session implements IUserSession, Emitter {
* Check if login names match
*/
private function validateTokenLoginName(?string $loginName, IToken $token): bool {
if ($token->getLoginName() !== $loginName) {
if (strtolower($token->getLoginName() ?? '') !== strtolower($loginName ?? '')) {
// TODO: this makes it impossible to use different login names on browser and client
// e.g. login by e-mail 'user@example.com' on browser for generating the token will not
// allow to use the client token with the login name 'user'.