check with trailing slash

This commit is contained in:
Mads Rasmussen
2024-05-27 16:22:02 +02:00
parent 6d4ec730b1
commit ffff49f411

View File

@@ -10,6 +10,7 @@ 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';
import { ensurePathEndsWithSlash } from '@umbraco-cms/backoffice/utils';
export class UmbCurrentUserContext extends UmbContextBase<UmbCurrentUserContext> {
#currentUser = new UmbObjectState<UmbCurrentUserModel | undefined>(undefined);
@@ -86,7 +87,7 @@ export class UmbCurrentUserContext extends UmbContextBase<UmbCurrentUserContext>
const appContext = await this.getContext(UMB_APP_CONTEXT);
const backofficePath = appContext.getBackofficePath();
if (url.pathname === backofficePath) {
if (url.pathname === ensurePathEndsWithSlash(backofficePath)) {
const sectionManifest = await this.#firstAllowedSection();
if (!sectionManifest) return;