Fix #339: Subsonic API login is now case insensitive

This commit is contained in:
Eliot Berriot 2018-06-28 16:47:45 +02:00
parent 002f3a9507
commit 281bef48bf
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
3 changed files with 14 additions and 1 deletions

View file

@ -19,7 +19,7 @@ def authenticate(username, password):
password = password.replace("enc:", "", 1)
password = binascii.unhexlify(password).decode("utf-8")
user = User.objects.get(
username=username, is_active=True, subsonic_api_token=password
username__iexact=username, is_active=True, subsonic_api_token=password
)
except (User.DoesNotExist, binascii.Error):
raise exceptions.AuthenticationFailed("Wrong username or password.")