Explorar o código

Return MethodNotAllowedException if Pw is not set

Don't accept pre-hashed (not-plaintext) passwords as the auth
provider no longer supports this due to sha1+salting the passwords
in the database.
Joshua Boniface %!s(int64=6) %!d(string=hai) anos
pai
achega
e790f024c2
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      MediaBrowser.Api/UserService.cs

+ 5 - 0
MediaBrowser.Api/UserService.cs

@@ -379,6 +379,11 @@ namespace MediaBrowser.Api
                 throw new ResourceNotFoundException("User not found");
                 throw new ResourceNotFoundException("User not found");
             }
             }
 
 
+            if (!request.Pw)
+            {
+                throw new MethodNotAllowedException("Hashed-only passwords are not valid for this API.");
+            }
+
             return Post(new AuthenticateUserByName
             return Post(new AuthenticateUserByName
             {
             {
                 Username = user.Name,
                 Username = user.Name,