The Free Software Media System - Server Backend & API
change authentication flow
dkanada26dd67a441d2
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex ec3e875732..659483a361 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -1379,20 +1379,16 @@ namespace Emby.Server.Implementations.Sessionuser = _userManager.GetUserByName(request.Username);}- if (user != null)+ if (user == null){- // TODO: Move this to userManager?- if (!string.IsNullOrEmpty(request.DeviceId)- && !_deviceManager.CanAccessDevice(user, request.DeviceId))- {- throw new SecurityException("User is not allowed access from this device.");- }+ AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));+ throw new SecurityException("Invalid username or password entered.");}- if (user == null)+ if (!string.IsNullOrEmpty(request.DeviceId)+ && !_deviceManager.CanAccessDevice(user, request.DeviceId)){- AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));- throw new SecurityException("Invalid user or password entered.");+ throw new SecurityException("User is not allowed access from this device.");}if (enforcePassword)