mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-27 03:04:49 +03:00
Return correct status codes for authentication and authorization errors
- Use AuthenticatonException to return 401 - Use SecurityException to return 403 - Update existing throws to throw the correct exception for the circumstance
This commit is contained in:
@@ -1414,7 +1414,7 @@ namespace Emby.Server.Implementations.Session
|
||||
if (user == null)
|
||||
{
|
||||
AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
|
||||
throw new SecurityException("Invalid username or password entered.");
|
||||
throw new AuthenticationException("Invalid username or password entered.");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(request.DeviceId)
|
||||
|
||||
Reference in New Issue
Block a user