Skip to content

Commit a4760ef

Browse files
authored
Merge pull request #50989 from nextcloud/case-insensitive-login
fix: Use case insensitive check when validating login name
2 parents 4479b27 + 32e46a8 commit a4760ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/User/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ private function validateToken($token, $user = null) {
780780
* Check if login names match
781781
*/
782782
private function validateTokenLoginName(?string $loginName, IToken $token): bool {
783-
if ($token->getLoginName() !== $loginName) {
783+
if (mb_strtolower($token->getLoginName()) !== mb_strtolower($loginName ?? '')) {
784784
// TODO: this makes it impossible to use different login names on browser and client
785785
// e.g. login by e-mail 'user@example.com' on browser for generating the token will not
786786
// allow to use the client token with the login name 'user'.

0 commit comments

Comments
 (0)