mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-14 03:23:49 +00:00
feat(#29): use magic link to sign in
This commit is contained in:
@@ -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')
|
||||
}
|
||||
Reference in New Issue
Block a user