diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
| commit | ecc6a55aba7bb35fc778e7a53848396b88214151 (patch) | |
| tree | 1b37a2dc5f4594155114da1ae0c4529d20a4c548 /web/composables/logout.ts | |
| parent | 8f7dec8ba6b2f9bde01afd0a110596ebbd43e0ed (diff) | |
Add multiple conferences feature
Diffstat (limited to 'web/composables/logout.ts')
| -rw-r--r-- | web/composables/logout.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/web/composables/logout.ts b/web/composables/logout.ts new file mode 100644 index 0000000..35b0511 --- /dev/null +++ b/web/composables/logout.ts @@ -0,0 +1,15 @@ +export function logout() { + const authStore = useAuthStore() + const conferenceStore = useConferenceStore() + const config = useRuntimeConfig(); + + $api(config.public.baseURL + '/logout', { method: 'POST' }).finally(() => { + authStore.admin = false; + authStore.username = null; + authStore.token = null; + + conferenceStore.clear() + + navigateTo({ path: '/login', state: { error: 'You have logged out' } }); + }) +}
\ No newline at end of file |
