removed the test code from #72

pull/158/head
tidusjar 9 years ago
parent 213a088f07
commit 866b6d6d6d

@ -30,6 +30,9 @@ using Nancy.Extensions;
using PlexRequests.UI.Models;
using System;
using PlexRequests.Core;
using PlexRequests.Core.SettingModels;
namespace PlexRequests.UI.Modules
{
public class BaseAuthModule : BaseModule
@ -74,11 +77,14 @@ namespace PlexRequests.UI.Modules
private Response CheckAuth()
{
if (Session[SessionKeys.UsernameKey] == null)
{
return Context.GetRedirect("~/test/userlogin");
}
return null;
var settings = Locator.Resolve<ISettingsService<PlexRequestSettings>>().GetSettings();
var baseUrl = settings.BaseUrl;
var redirectPath = string.IsNullOrEmpty(baseUrl) ? "~/userlogin" : $"~/{baseUrl}/userlogin";
return Session[SessionKeys.UsernameKey] == null
? Context.GetRedirect(redirectPath)
: null;
}
}

@ -34,7 +34,7 @@ namespace PlexRequests.UI.Modules
{
public class BaseModule : NancyModule
{
private ServiceLocator Locator => ServiceLocator.Instance;
protected ServiceLocator Locator => ServiceLocator.Instance;
public BaseModule()
{
var settings = Locator.Resolve<ISettingsService<PlexRequestSettings>>().GetSettings();

Loading…
Cancel
Save