diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-13 13:17:46 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-13 13:17:46 -0400 |
| commit | 53380689ad00f00efc0c1790f1d25d08c95d7f2d (patch) | |
| tree | 8ab0d53b8242902bbf69e10fbacd1e3b360543ca /Emby.Server.Implementations/Session/SessionManager.cs | |
| parent | 6d35dd6b326b98995e363c64083a2ca46b2582fd (diff) | |
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
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionManager.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index de768333d..c93c02c48 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -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) |
