mirror of
https://github.com/SkalaraAI/skalara-web.git
synced 2025-04-05 13:00:19 -04:00
19 lines
584 B
TypeScript
19 lines
584 B
TypeScript
import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs";
|
|
import { cookies } from "next/headers";
|
|
import { NextResponse } from "next/server";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET(request: Request) {
|
|
const requestUrl = new URL(request.url);
|
|
const code = requestUrl.searchParams.get("code");
|
|
|
|
if (code) {
|
|
const supabase = createRouteHandlerClient({ cookies });
|
|
await supabase.auth.exchangeCodeForSession(code);
|
|
}
|
|
|
|
// URL to redirect to after sign in process completes
|
|
return NextResponse.redirect(requestUrl.origin);
|
|
}
|