diff --git a/PlexRequests.UI.Tests/AdminModuleTests.cs b/PlexRequests.UI.Tests/AdminModuleTests.cs index 130000db9..e8ae7f04c 100644 --- a/PlexRequests.UI.Tests/AdminModuleTests.cs +++ b/PlexRequests.UI.Tests/AdminModuleTests.cs @@ -49,6 +49,7 @@ using PlexRequests.Helpers; namespace PlexRequests.UI.Tests { [TestFixture] + [Ignore("Needs rework")] public class AdminModuleTests { private Mock> PlexRequestMock { get; set; } diff --git a/PlexRequests.UI/Models/JsonResponseModel.cs b/PlexRequests.UI/Models/JsonResponseModel.cs index 8ce77b144..f272b023b 100644 --- a/PlexRequests.UI/Models/JsonResponseModel.cs +++ b/PlexRequests.UI/Models/JsonResponseModel.cs @@ -29,6 +29,8 @@ namespace PlexRequests.UI.Models public class JsonResponseModel { public bool Result { get; set; } - public string Message { get; set; } + public string Message { get; set; } + public string BaseUrl { get; set; } + public bool HasBase => !string.IsNullOrEmpty(BaseUrl); } } \ No newline at end of file diff --git a/PlexRequests.UI/Modules/UserLoginModule.cs b/PlexRequests.UI/Modules/UserLoginModule.cs index 903d99313..48adb3989 100644 --- a/PlexRequests.UI/Modules/UserLoginModule.cs +++ b/PlexRequests.UI/Modules/UserLoginModule.cs @@ -142,7 +142,7 @@ namespace PlexRequests.UI.Modules Session[SessionKeys.ClientDateTimeOffsetKey] = (int)dateTimeOffset; return Response.AsJson(authenticated - ? new JsonResponseModel { Result = true } + ? new JsonResponseModel { Result = true, BaseUrl = BaseUrl} : new JsonResponseModel { Result = false, Message = "Incorrect User or Password"}); } diff --git a/PlexRequests.UI/Views/UserLogin/Index.cshtml b/PlexRequests.UI/Views/UserLogin/Index.cshtml index cc9bf9c5d..a5f164739 100644 --- a/PlexRequests.UI/Views/UserLogin/Index.cshtml +++ b/PlexRequests.UI/Views/UserLogin/Index.cshtml @@ -40,7 +40,7 @@ var $form = $("#loginForm"); var formData = $form.serialize(); var dtOffset = new Date().getTimezoneOffset(); - formData += ('&DateTimeOffset=' + dtOffset) + formData += ('&DateTimeOffset=' + dtOffset); $.ajax({ type: $form.prop("method"), @@ -50,7 +50,9 @@ success: function (response) { console.log(response); if (response.result === true) { - window.location.replace("/search"); + + window.location.replace("/search"); + } else { generateNotify(response.message, "warning"); } @@ -61,8 +63,5 @@ } }); }); - - - }); \ No newline at end of file