From 5bab6ca96bf107a634ce844f3d0fa20d0f000ea0 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 22 May 2024 10:17:56 +0200 Subject: [PATCH] feat: if basic auth, delete the stored token --- src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts b/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts index c689e1e66a..10aec07725 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts @@ -173,9 +173,13 @@ export class UmbAppElement extends UmbLitElement { // Try to initialise the auth flow and get the runtime status try { - // If the runtime level is "install" we should clear any cached tokens + // If the runtime level is "install" or ?status=false is set, we should clear any cached tokens // else we should try and set the auth status - if (this.#serverConnection.getStatus() === RuntimeLevelModel.INSTALL) { + const searchParams = new URLSearchParams(window.location.search); + if ( + (searchParams.has('status') && searchParams.get('status') === 'false') || + this.#serverConnection.getStatus() === RuntimeLevelModel.INSTALL + ) { await this.#authContext.clearTokenStorage(); } else { await this.#setAuthStatus();