diff --git a/PlexRequests.UI.Tests/UserLoginModuleTests.cs b/PlexRequests.UI.Tests/UserLoginModuleTests.cs index 16b138eea..22f57750e 100644 --- a/PlexRequests.UI.Tests/UserLoginModuleTests.cs +++ b/PlexRequests.UI.Tests/UserLoginModuleTests.cs @@ -72,9 +72,9 @@ namespace PlexRequests.UI.Tests LandingPageMock.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new LandingPageSettings()); IAnalytics = new Mock(); Linker = new Mock(); - Linker.Setup(x => x.BuildAbsoluteUri(It.IsAny(), "SearchIndex", null)).Returns(new Uri("http://www.searchindex.com")); - Linker.Setup(x => x.BuildAbsoluteUri(It.IsAny(), "LandingPageIndex", null)).Returns(new Uri("http://www.landingpage.com")); - Linker.Setup(x => x.BuildAbsoluteUri(It.IsAny(), "UserLoginIndex", null)).Returns(new Uri("http://www.userloginindex.com")); + Linker.Setup(x => x.BuildRelativeUri(It.IsAny(), "SearchIndex", null)).Returns(new Uri("http://www.searchindex.com")); + Linker.Setup(x => x.BuildRelativeUri(It.IsAny(), "LandingPageIndex", null)).Returns(new Uri("http://www.landingpage.com")); + Linker.Setup(x => x.BuildRelativeUri(It.IsAny(), "UserLoginIndex", null)).Returns(new Uri("http://www.userloginindex.com")); PlexSettingsMock = new Mock>(); PlexSettingsMock.Setup(x => x.GetSettingsAsync()).ReturnsAsync(new PlexSettings() {PlexAuthToken = "abc"}); Bootstrapper = new ConfigurableBootstrapper(with => diff --git a/PlexRequests.UI/Modules/IndexModule.cs b/PlexRequests.UI/Modules/IndexModule.cs index 3d7023d39..fd13acb35 100644 --- a/PlexRequests.UI/Modules/IndexModule.cs +++ b/PlexRequests.UI/Modules/IndexModule.cs @@ -59,23 +59,23 @@ namespace PlexRequests.UI.Modules if (!string.IsNullOrEmpty(Username)) { // They are not logged in - return Context.GetRedirect(Linker.BuildAbsoluteUri(Context, "LandingPageIndex").ToString()); + return Context.GetRedirect(Linker.BuildRelativeUri(Context, "LandingPageIndex").ToString()); } - return Context.GetRedirect(Linker.BuildAbsoluteUri(Context, "SearchIndex").ToString()); + return Context.GetRedirect(Linker.BuildRelativeUri(Context, "SearchIndex").ToString()); } // After login if (string.IsNullOrEmpty(Username)) { // Not logged in yet - return Context.GetRedirect(Linker.BuildAbsoluteUri(Context, "UserLoginIndex").ToString()); + return Context.GetRedirect(Linker.BuildRelativeUri(Context, "UserLoginIndex").ToString()); } // Send them to landing - var landingUrl = Linker.BuildAbsoluteUri(Context, "LandingPageIndex").ToString(); + var landingUrl = Linker.BuildRelativeUri(Context, "LandingPageIndex").ToString(); return Context.GetRedirect(landingUrl); } - return Context.GetRedirect(Linker.BuildAbsoluteUri(Context, "UserLoginIndex").ToString()); + return Context.GetRedirect(Linker.BuildRelativeUri(Context, "UserLoginIndex").ToString()); } } } \ No newline at end of file diff --git a/PlexRequests.UI/Modules/LandingPageModule.cs b/PlexRequests.UI/Modules/LandingPageModule.cs index 92517f2f7..dccf69430 100644 --- a/PlexRequests.UI/Modules/LandingPageModule.cs +++ b/PlexRequests.UI/Modules/LandingPageModule.cs @@ -52,7 +52,7 @@ namespace PlexRequests.UI.Modules var s = await LandingSettings.GetSettingsAsync(); if (!s.BeforeLogin && string.IsNullOrEmpty(Username)) //We are signed in { - var url = Linker.BuildAbsoluteUri(Context, "SearchIndex").ToString(); + var url = Linker.BuildRelativeUri(Context, "SearchIndex").ToString(); return Response.AsRedirect(url); } diff --git a/PlexRequests.UI/Modules/UserLoginModule.cs b/PlexRequests.UI/Modules/UserLoginModule.cs index 97879089e..e30f4adc2 100644 --- a/PlexRequests.UI/Modules/UserLoginModule.cs +++ b/PlexRequests.UI/Modules/UserLoginModule.cs @@ -65,7 +65,7 @@ namespace PlexRequests.UI.Modules { if (!string.IsNullOrEmpty(Username) || IsAdmin) { - var uri = Linker.BuildAbsoluteUri(Context, "SearchIndex"); + var uri = Linker.BuildRelativeUri(Context, "SearchIndex"); return Response.AsRedirect(uri.ToString()); } var settings = await AuthService.GetSettingsAsync(); @@ -93,7 +93,7 @@ namespace PlexRequests.UI.Modules if (string.IsNullOrWhiteSpace(username)) { Session["TempMessage"] = Resources.UI.UserLogin_IncorrectUserPass; - var uri = Linker.BuildAbsoluteUri(Context, "UserLoginIndex"); + var uri = Linker.BuildRelativeUri(Context, "UserLoginIndex"); return Response.AsRedirect(uri.ToString()); // TODO Check this } @@ -106,7 +106,7 @@ namespace PlexRequests.UI.Modules { Log.Debug("User is in denied list, not allowing them to authenticate"); Session["TempMessage"] = Resources.UI.UserLogin_IncorrectUserPass; - var uri = Linker.BuildAbsoluteUri(Context, "UserLoginIndex"); + var uri = Linker.BuildRelativeUri(Context, "UserLoginIndex"); return Response.AsRedirect(uri.ToString()); // TODO Check this } @@ -165,7 +165,7 @@ namespace PlexRequests.UI.Modules if (!authenticated) { - var uri = Linker.BuildAbsoluteUri(Context, "UserLoginIndex"); + var uri = Linker.BuildRelativeUri(Context, "UserLoginIndex"); Session["TempMessage"] = Resources.UI.UserLogin_IncorrectUserPass; return Response.AsRedirect(uri.ToString()); // TODO Check this } @@ -176,11 +176,11 @@ namespace PlexRequests.UI.Modules { if (!landingSettings.BeforeLogin) { - var uri = Linker.BuildAbsoluteUri(Context, "LandingPageIndex"); + var uri = Linker.BuildRelativeUri(Context, "LandingPageIndex"); return Response.AsRedirect(uri.ToString()); } } - var retVal = Linker.BuildAbsoluteUri(Context, "SearchIndex"); + var retVal = Linker.BuildRelativeUri(Context, "SearchIndex"); return Response.AsRedirect(retVal.ToString()); // TODO Check this }