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

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

Loading…
Cancel
Save