mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-27 04:22:08 +00:00
make controller project portable
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using MediaBrowser.Controller.Connect;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Controller.Security;
|
||||
using ServiceStack.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Services;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
||||
{
|
||||
@@ -21,7 +21,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
||||
|
||||
public AuthorizationInfo GetAuthorizationInfo(object requestContext)
|
||||
{
|
||||
var req = new ServiceStackServiceRequest((IRequest)requestContext);
|
||||
var req = new ServiceRequest((IRequest)requestContext);
|
||||
return GetAuthorizationInfo(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
using MediaBrowser.Controller.Net;
|
||||
using ServiceStack;
|
||||
using ServiceStack.Auth;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
||||
{
|
||||
public class SessionAuthProvider : CredentialsAuthProvider
|
||||
{
|
||||
private readonly ISessionContext _sessionContext;
|
||||
|
||||
public SessionAuthProvider(ISessionContext sessionContext)
|
||||
{
|
||||
_sessionContext = sessionContext;
|
||||
}
|
||||
|
||||
public override bool TryAuthenticate(IServiceBase authService, string userName, string password)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool IsAuthorized(IAuthSession session, IAuthTokens tokens, Authenticate request = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void SaveUserAuth(IServiceBase authService, IAuthSession session, IAuthRepository authRepo, IAuthTokens tokens)
|
||||
{
|
||||
}
|
||||
|
||||
public override object Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)
|
||||
{
|
||||
return base.Authenticate(authService, session, request);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Controller.Security;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using ServiceStack.Web;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Services;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
||||
|
||||
public Task<SessionInfo> GetSession(object requestContext)
|
||||
{
|
||||
var req = new ServiceStackServiceRequest((IRequest)requestContext);
|
||||
var req = new ServiceRequest((IRequest)requestContext);
|
||||
return GetSession(req);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
||||
|
||||
public Task<User> GetUser(object requestContext)
|
||||
{
|
||||
var req = new ServiceStackServiceRequest((IRequest)requestContext);
|
||||
var req = new ServiceRequest((IRequest)requestContext);
|
||||
return GetUser(req);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user