mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 11:03:44 +00:00
21 lines
481 B
Svelte
21 lines
481 B
Svelte
<script lang="ts">
|
|
import { createEventDispatcher } from 'svelte';
|
|
const dispatch = createEventDispatcher();
|
|
|
|
function emitSignedOutEvent() {
|
|
dispatch('signedOut', {});
|
|
}
|
|
|
|
// Access the supabase client from the layout data
|
|
export let supabase: any;
|
|
|
|
async function signOut() {
|
|
// TODO use the error from the response
|
|
const { error } = await supabase.auth.signOut().then(() => {
|
|
emitSignedOutEvent();
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<button on:click={signOut}>Sign Out</button>
|