signout route
This commit is contained in:
10
src/routes/auth/signout/+server.ts
Normal file
10
src/routes/auth/signout/+server.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import type { RequestHandler } from './$types';
|
||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const GET: RequestHandler = async ({ locals }) => {
|
||||||
|
// If using supabase-js client on the server, you can sign out here
|
||||||
|
if (locals.supabase) {
|
||||||
|
await locals.supabase.auth.signOut();
|
||||||
|
}
|
||||||
|
throw redirect(303, '/');
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user