Merge pull request #50989 from nextcloud/case-insensitive-login

fix: Use case insensitive check when validating login name
This commit is contained in:
Enjeck 2025-03-05 06:19:16 +00:00 committed by GitHub
commit a4760ef906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 (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'.