diff --git a/src/App.vue b/src/App.vue index 5d0ee7f..3cd35b5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,7 +9,6 @@ const profileStore = useProfileStore(); onMounted(() => { profileStore.fromUrl(); console.log(document.location.toString()); - console.log(profileStore.token); setupAuth(profileStore.token); }); diff --git a/src/store/profileStore.ts b/src/store/profileStore.ts index 7436663..e25ddbf 100644 --- a/src/store/profileStore.ts +++ b/src/store/profileStore.ts @@ -5,7 +5,7 @@ import { LocalStorage, LocalStorageItem } from '../models/LocalStorage'; export const useProfileStore = defineStore('profile', () => { const id = ref(null); const email = ref(null); - const token = ref(); + const token = ref(undefined); const groups = ref(null); const indirectGroups = ref(null); const userScopes = ref(null); @@ -22,10 +22,10 @@ export const useProfileStore = defineStore('profile', () => { const urlScopes = url.searchParams.get('scopes')?.split(','); if (urlToken === null && urlScopes === undefined) { - token.value = localToken; + token.value = localToken === null ? undefined : localToken; sessionScopes.value = localScopes; } else { - token.value = urlToken; + token.value = urlToken === null ? undefined : urlToken; sessionScopes.value = urlScopes || []; LocalStorage.set(LocalStorageItem.Token, urlToken); LocalStorage.set(LocalStorageItem.TokenScopes, urlScopes);