feat(#29): use magic link to sign in

This commit is contained in:
OllyNicholass
2024-09-17 21:14:39 +01:00
parent 32a3feef64
commit 6e1d38ef58
7 changed files with 65 additions and 39 deletions
+14
View File
@@ -0,0 +1,14 @@
import { redirect, type RequestHandler } from '@sveltejs/kit'
export const GET: RequestHandler = async (event) => {
const { url, locals: { supabase } } = event;
const code = url.searchParams.get('code')
if (code) {
await supabase.auth.exchangeCodeForSession(code)
}
// TODO: Create stripe customer and sync with supabase user
throw redirect(303, '/account')
}