Skip to content

Commit

Permalink
Add logout page
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellrgn committed Feb 4, 2025
1 parent 6cfbbfe commit 9156d0d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/routes/(app)/auth/logout/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script lang="ts">
import { onMount } from 'svelte';
import { Alert } from 'sveltestrap';
import { goto } from '$app/navigation';
import { AuthService } from '$lib/utils/AuthService';
let authService = AuthService.Instance;
let errorMsg = "";
onMount(() => {
try {
authService.logout();
} catch (e) {
console.error(e);
errorMsg = "Unable to log out.";
goto('/home');
}
});
</script>

<svelte:head>
<title>WA Verify+ - Logout</title>
</svelte:head>

{#if errorMsg}
<Alert color="danger">
{errorMsg}
</Alert>
{/if}

0 comments on commit 9156d0d

Please sign in to comment.