mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
Move SecurityException
This commit is contained in:
parent
4b6889615b
commit
d5c226b1c3
@ -19,6 +19,11 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
||||
public AuthorizationInfo Authenticate(HttpRequest request)
|
||||
{
|
||||
var auth = _authorizationContext.GetAuthorizationInfo(request);
|
||||
if (auth == null)
|
||||
{
|
||||
throw new SecurityException("Unauthenticated request.");
|
||||
}
|
||||
|
||||
if (auth.User?.HasPermission(PermissionKind.IsDisabled) ?? false)
|
||||
{
|
||||
throw new SecurityException("User account has been disabled.");
|
||||
|
@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
||||
if (string.IsNullOrWhiteSpace(token))
|
||||
{
|
||||
// Request doesn't contain a token.
|
||||
throw new SecurityException("Unauthorized.");
|
||||
return (null, null);
|
||||
}
|
||||
|
||||
var result = _authRepo.Get(new AuthenticationInfoQuery
|
||||
|
Loading…
Reference in New Issue
Block a user