Maintenance page when in upgrade state (#13551)
* Added functionality to show maintenance page and fixed issues with showing custom api controllers and 404 page, when umbraco had been in install or upgrade state * Fixed Tests * Fixed typo * Fixed issue with login screen redirecting to website when in upgrade state, instead of backoffice
This commit is contained in:
@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
@@ -120,6 +121,13 @@ public class BackOfficeController : UmbracoController
|
||||
// Check if we not are in an run state, if so we need to redirect
|
||||
if (_runtimeState.Level != RuntimeLevel.Run)
|
||||
{
|
||||
if (_runtimeState.Level == RuntimeLevel.Upgrade)
|
||||
{
|
||||
return RedirectToAction(nameof(AuthorizeUpgrade), routeValues: new RouteValueDictionary()
|
||||
{
|
||||
["redir"] = _globalSettings.GetBackOfficePath(_hostingEnvironment),
|
||||
});
|
||||
}
|
||||
return Redirect("/");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user