From 33c7dde46dafccb918d64c663c5dd3788b2ef406 Mon Sep 17 00:00:00 2001 From: Alex Moran Date: Tue, 21 Nov 2017 12:38:14 -0800 Subject: [PATCH 1/3] Added hotfix for initial WindowsAuthentication use. --- Bonobo.Git.Server/Controllers/RepositoryController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonobo.Git.Server/Controllers/RepositoryController.cs b/Bonobo.Git.Server/Controllers/RepositoryController.cs index 81c4c61a0..34d6cfaf3 100644 --- a/Bonobo.Git.Server/Controllers/RepositoryController.cs +++ b/Bonobo.Git.Server/Controllers/RepositoryController.cs @@ -41,7 +41,7 @@ public ActionResult Index(string sortGroup = null, string searchString = null) var unorderedRepositoryDetails = GetIndexModel().ToList(); if (!User.Identity.IsAuthenticated && !unorderedRepositoryDetails.Any()) { - return RedirectToAction("Logon", "Home", new { returnUrl = Url.Action("index", "Home") }); + return RedirectToAction((AuthenticationProvider is WindowsAuthenticationProvider ? "WindowsLogin" : "Logon"), "Home", new { returnUrl = Url.Action("index", "Home") }); } if (!string.IsNullOrEmpty(searchString)) { From 8ec4cabb6aba8fe7abc665bd0dd40438b0690870 Mon Sep 17 00:00:00 2001 From: Alex Moran Date: Thu, 1 Feb 2018 15:52:05 -0800 Subject: [PATCH 2/3] Check for Windows Auth and if active, redirct to WindowsLogin ActionResult. --- Bonobo.Git.Server/Controllers/HomeController.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Bonobo.Git.Server/Controllers/HomeController.cs b/Bonobo.Git.Server/Controllers/HomeController.cs index 3668cc281..676cc6942 100644 --- a/Bonobo.Git.Server/Controllers/HomeController.cs +++ b/Bonobo.Git.Server/Controllers/HomeController.cs @@ -166,6 +166,9 @@ public ActionResult WindowsLogin(string returnUrl) public ActionResult LogOn(string returnUrl) { + if (AuthenticationProvider is WindowsAuthenticationProvider) { + return RedirectToAction("WindowsLogin", new { ReturnUrl = returnUrl }); + } return View(new LogOnModel { ReturnUrl = returnUrl }); } From 518677f4f73b3a4074dea9d465ca089172dc9797 Mon Sep 17 00:00:00 2001 From: Alex Moran Date: Thu, 1 Feb 2018 15:53:16 -0800 Subject: [PATCH 3/3] Revert "Added hotfix for initial WindowsAuthentication use." This reverts commit 33c7dde46dafccb918d64c663c5dd3788b2ef406. --- Bonobo.Git.Server/Controllers/RepositoryController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonobo.Git.Server/Controllers/RepositoryController.cs b/Bonobo.Git.Server/Controllers/RepositoryController.cs index 34d6cfaf3..81c4c61a0 100644 --- a/Bonobo.Git.Server/Controllers/RepositoryController.cs +++ b/Bonobo.Git.Server/Controllers/RepositoryController.cs @@ -41,7 +41,7 @@ public ActionResult Index(string sortGroup = null, string searchString = null) var unorderedRepositoryDetails = GetIndexModel().ToList(); if (!User.Identity.IsAuthenticated && !unorderedRepositoryDetails.Any()) { - return RedirectToAction((AuthenticationProvider is WindowsAuthenticationProvider ? "WindowsLogin" : "Logon"), "Home", new { returnUrl = Url.Action("index", "Home") }); + return RedirectToAction("Logon", "Home", new { returnUrl = Url.Action("index", "Home") }); } if (!string.IsNullOrEmpty(searchString)) {