mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-10 15:32:37 -07:00
Removed the service locator from the base classes and added in some Api tests
added all the tests back in!
This commit is contained in:
parent
187a59261a
commit
84dc4515fd
21 changed files with 251 additions and 176 deletions
|
@ -75,20 +75,23 @@ namespace PlexRequests.UI.Modules
|
|||
}
|
||||
}
|
||||
|
||||
protected BaseAuthModule()
|
||||
protected BaseAuthModule(ISettingsService<PlexRequestSettings> pr) : base(pr)
|
||||
{
|
||||
Service = pr;
|
||||
Before += (ctx) => CheckAuth();
|
||||
}
|
||||
|
||||
protected BaseAuthModule(string modulePath) : base(modulePath)
|
||||
protected BaseAuthModule(string modulePath, ISettingsService<PlexRequestSettings> pr) : base(modulePath, pr)
|
||||
{
|
||||
Service = pr;
|
||||
Before += (ctx) => CheckAuth();
|
||||
}
|
||||
|
||||
private ISettingsService<PlexRequestSettings> Service { get; }
|
||||
|
||||
private Response CheckAuth()
|
||||
{
|
||||
var settings = Locator.Resolve<ISettingsService<PlexRequestSettings>>().GetSettings();
|
||||
var settings = Service.GetSettings();
|
||||
var baseUrl = settings.BaseUrl;
|
||||
|
||||
var redirectPath = string.IsNullOrEmpty(baseUrl) ? "~/userlogin" : $"~/{baseUrl}/userlogin";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue