feat: if basic auth, delete the stored token

This commit is contained in:
Jacob Overgaard
2024-05-22 10:17:56 +02:00
parent fe0e2593f7
commit 5bab6ca96b

View File

@@ -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();