diff --git a/src/Umbraco.Core/UriExtensions.cs b/src/Umbraco.Core/UriExtensions.cs
index 45cb906eef..6ace17220b 100644
--- a/src/Umbraco.Core/UriExtensions.cs
+++ b/src/Umbraco.Core/UriExtensions.cs
@@ -100,6 +100,29 @@ namespace Umbraco.Core
return true;
}
+ ///
+ /// Checks if it is a back office login or logout request
+ ///
+ ///
+ ///
+ ///
+ internal static bool IsBackOfficeLoginRequest(this Uri url, string applicationPath)
+ {
+ applicationPath = applicationPath ?? string.Empty;
+
+ var fullUrlPath = url.AbsolutePath.TrimStart(new[] { '/' });
+ var appPath = applicationPath.TrimStart(new[] { '/' });
+ var urlPath = fullUrlPath.TrimStart(appPath).EnsureStartsWith('/');
+
+ if (urlPath.InvariantStartsWith(GlobalSettings.Path.EnsureStartsWith('/') + "/login.aspx")
+ || urlPath.InvariantStartsWith(GlobalSettings.Path.EnsureStartsWith('/') + "/logout.aspx"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
///
/// Checks if the current uri is an install request
///
diff --git a/src/Umbraco.Web.UI/install/Default.aspx.cs b/src/Umbraco.Web.UI/install/Default.aspx.cs
index 5a58949b8c..5ce92070a8 100644
--- a/src/Umbraco.Web.UI/install/Default.aspx.cs
+++ b/src/Umbraco.Web.UI/install/Default.aspx.cs
@@ -72,7 +72,7 @@ namespace Umbraco.Web.UI.Install
case ValidateRequestAttempt.FailedNoContextId:
Response.Redirect(
//We must add the token to prevent CSRF attacks since the logout occurs on a GET not a POST
- SystemDirectories.Umbraco + "/logout.aspx?redir=" + Server.UrlEncode(Request.RawUrl) + "&t=" + Security.UmbracoUserContextId);
+ SystemDirectories.Umbraco + "/login.aspx?redir=" + Server.UrlEncode(Request.RawUrl) + "&t=" + Security.UmbracoUserContextId);
break;
}
}
diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs
index 3a616e22bc..a321196b88 100644
--- a/src/Umbraco.Web/UmbracoModule.cs
+++ b/src/Umbraco.Web/UmbracoModule.cs
@@ -83,6 +83,12 @@ namespace Umbraco.Web
var umbracoContext = UmbracoContext.Current;
+ //if it's a back office login request, do not continue
+ if (httpContext.Request.Url.IsBackOfficeLoginRequest(HttpRuntime.AppDomainAppVirtualPath))
+ {
+ return;
+ }
+
//if it's a back office request then we need to ensure we're configured - otherwise redirect to installer
if (httpContext.Request.Url.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath)
&& EnsureIsConfigured(httpContext, umbracoContext.OriginalRequestUrl) == false)
@@ -386,7 +392,7 @@ namespace Umbraco.Web
LogHelper.Warn("Umbraco is not configured");
- var installPath = UriUtility.ToAbsolute(Core.IO.SystemDirectories.Install);
+ var installPath = UriUtility.ToAbsolute(SystemDirectories.Install);
var installUrl = string.Format("{0}/default.aspx?redir=true&url={1}", installPath, HttpUtility.UrlEncode(uri.ToString()));
httpContext.Response.Redirect(installUrl, true);
return false;