mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
change authentication flow
This commit is contained in:
parent
6341d986a9
commit
26dd67a441
@ -1379,20 +1379,16 @@ namespace Emby.Server.Implementations.Session
|
|||||||
user = _userManager.GetUserByName(request.Username);
|
user = _userManager.GetUserByName(request.Username);
|
||||||
}
|
}
|
||||||
|
|
||||||
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.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
|
AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
|
||||||
throw new SecurityException("Invalid user or password entered.");
|
throw new SecurityException("Invalid username or password entered.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(request.DeviceId)
|
||||||
|
&& !_deviceManager.CanAccessDevice(user, request.DeviceId))
|
||||||
|
{
|
||||||
|
throw new SecurityException("User is not allowed access from this device.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enforcePassword)
|
if (enforcePassword)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user