Skip to content

Commit

Permalink
Fix sign out page
Browse files Browse the repository at this point in the history
 - Ugly layout
 - If we tried to render server side it errorer (no goto)
 - It was signing out on load, not on mount
  • Loading branch information
scosman committed Sep 2, 2024
1 parent 57b974d commit 6b60de6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/routes/(admin)/account/sign_out/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<script lang="ts">
import { goto } from "$app/navigation"
import { onMount } from "svelte"
export let data
let { supabase } = data
let message = "Signing out...."
supabase.auth.signOut().then(({ error }) => {
if (error) {
message = "There was an issue signing out."
} else {
goto("/")
}
// on mount, sign out
onMount(() => {
supabase.auth.signOut().then(({ error }) => {
if (error) {
message = "There was an issue signing out."
} else {
goto("/")
}
})
})
</script>

<h1 class="text-2xl font-bold m-6">{message}</h1>
<h1 class="text-2xl font-bold m-6 mx-auto my-auto">{message}</h1>

0 comments on commit 6b60de6

Please sign in to comment.