Merge pull request #51252 from nextcloud/backport/50989/stable30

[stable30] fix: Use case insensitive check when validating login name
This commit is contained in:
Andy Scherzinger 2025-03-05 17:48:25 +01:00 committed by GitHub
commit 7bbeae4c3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -779,7 +779,7 @@ class Session implements IUserSession, Emitter {
* Check if login names match
*/
private function validateTokenLoginName(?string $loginName, IToken $token): bool {
if ($token->getLoginName() !== $loginName) {
if (mb_strtolower($token->getLoginName()) !== mb_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'.