Something went wrong. Try again.
eny.space base page eny.space
atproto pds managed hosting
Something went wrong. Try again.
1234567891011121314151617181920212223import { createClient } from "@/lib/supabase/server";import { NextResponse } from "next/server";
export async function exchangeCodeAndRedirect( request: Request, code: string | null, successPath: string, errorPath: string): Promise<NextResponse> { if (!code) { return NextResponse.redirect(new URL(errorPath, request.url)); }
const supabase = await createClient(); const { error } = await supabase.auth.exchangeCodeForSession(code);
if (error) { return NextResponse.redirect(new URL(errorPath, request.url)); }
return NextResponse.redirect(new URL(successPath, request.url));}