diff --git a/src/stores/auth-store.ts b/src/stores/auth-store.ts index 3eecc6f..cee85c7 100644 --- a/src/stores/auth-store.ts +++ b/src/stores/auth-store.ts @@ -31,6 +31,10 @@ export const useAuthStore = defineStore('auth', () => { const logout = () => { user.value = undefined; + AuthService.logout(); + const logout_popup = window.open('https://auth.targo.ca/application/o/montargo/end-session/', 'logoutPopup', 'width=200,height=200'); + + setInterval(() => logout_popup?.close(), 2000); }; const handleAuthMessage = async (event: MessageEvent) => { @@ -61,13 +65,13 @@ export const useAuthStore = defineStore('auth', () => { return { status: 400, message: 'unknown error occured' }; } - return { - user, - authError, - login, - oidcLogin, - logout, - getProfile + return { + user, + authError, + login, + oidcLogin, + logout, + getProfile }; });