diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts index fc2d2044b1..2381e1600b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts @@ -9,6 +9,7 @@ import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api'; import { umbLocalizationRegistry } from '@umbraco-cms/backoffice/localization'; import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; import { UMB_SECTION_PATH_PATTERN } from '@umbraco-cms/backoffice/section'; +import { UMB_APP_CONTEXT } from '@umbraco-cms/backoffice/app'; export class UmbCurrentUserContext extends UmbContextBase { #currentUser = new UmbObjectState(undefined); @@ -82,7 +83,10 @@ export class UmbCurrentUserContext extends UmbContextBase async #redirectToFirstAllowedSectionIfNeeded() { const url = new URL(window.location.href); - if (url.pathname === '/') { + const appContext = await this.getContext(UMB_APP_CONTEXT); + const backofficePath = appContext.getBackofficePath(); + + if (url.pathname === backofficePath) { const sectionManifest = await this.#firstAllowedSection(); if (!sectionManifest) return;