Use authorization code from api-migration to fix startup wizard

This commit is contained in:
David
2020-06-20 18:02:03 +02:00
parent beb3896d7f
commit 1c78482b48
5 changed files with 108 additions and 38 deletions

View File

@@ -51,6 +51,22 @@ namespace Emby.Server.Implementations.HttpServer.Security
return user;
}
public AuthorizationInfo Authenticate(HttpRequest request)
{
var auth = _authorizationContext.GetAuthorizationInfo(request);
if (auth?.User == null)
{
return null;
}
if (auth.User.HasPermission(PermissionKind.IsDisabled))
{
throw new SecurityException("User account has been disabled.");
}
return auth;
}
private User ValidateUser(IRequest request, IAuthenticationAttributes authAttribtues)
{
// This code is executed before the service