summaryrefslogtreecommitdiff
path: root/ui/lib/components/LogOut.svelte
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-29 23:29:22 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-29 23:29:22 -0400
commit66d3fcf2e22f057bacce8d97d43a13c1c5a9ad09 (patch)
tree60995943e14a6568cf2b37622ce97df121865a6d /ui/lib/components/LogOut.svelte
parente328d33fc7d6a0f2e3d260d8bddee3ef633318eb (diff)
Add `change password` UI + API.
The protocol here re-checks the caller's password, as a "I left myself logged in" anti-pranking check.
Diffstat (limited to 'ui/lib/components/LogOut.svelte')
-rw-r--r--ui/lib/components/LogOut.svelte26
1 files changed, 0 insertions, 26 deletions
diff --git a/ui/lib/components/LogOut.svelte b/ui/lib/components/LogOut.svelte
deleted file mode 100644
index ba0861a..0000000
--- a/ui/lib/components/LogOut.svelte
+++ /dev/null
@@ -1,26 +0,0 @@
-<script>
- import { goto } from '$app/navigation';
- import { logOut} from '$lib/apiServer';
- import { currentUser } from '$lib/store';
-
- async function handleLogout() {
- const response = await logOut();
- if (200 <= response.status && response.status < 300) {
- currentUser.update(() => null);
- goto('/login');
- }
- }
-</script>
-
-<form on:submit|preventDefault={handleLogout}>
- {#if $currentUser}
- @{$currentUser.username}
- {/if}
- <button
- class="border-slate-500 border-solid border-2 font-bold p-1 rounded"
- type="submit"
- >log out</button>
-</form>
-
-<style>
-</style>