More signout fixes
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
|
||||||
import type { PageServerLoad } from './$types';
|
|
||||||
|
|
||||||
export const load: PageServerLoad = async ({ locals }) => {
|
|
||||||
await locals.supabase.auth.signOut();
|
|
||||||
throw redirect(303, '/');
|
|
||||||
};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { onMount } from 'svelte';
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
localStorage.clear();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<p>Signing out...</p>
|
|
||||||
11
src/routes/auth/signout/+server.ts
Normal file
11
src/routes/auth/signout/+server.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import type { RequestHandler } from './$types';
|
||||||
|
export const GET: RequestHandler = async ({ locals}) => {
|
||||||
|
await locals.supabase.auth.signOut();
|
||||||
|
|
||||||
|
const html = `
|
||||||
|
<script>
|
||||||
|
localStorage.clear();
|
||||||
|
location.href = '/';
|
||||||
|
</script>`;
|
||||||
|
return new Response(html, { headers: { 'Content-Type': 'text/html' } });
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user