diff options
| author | Fuwn <[email protected]> | 2026-02-03 21:07:28 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-03 21:07:28 -0800 |
| commit | e72b0cb261b5fc9c70a839882ea07160ef7ef424 (patch) | |
| tree | 0913ca6b24a078b91a64d15817d80d3cdaf56d32 /packages/web/src/app/api/auth | |
| parent | feat(mcp): Wire to Supabase with project and search tools (diff) | |
| download | archived-imemio-e72b0cb261b5fc9c70a839882ea07160ef7ef424.tar.xz archived-imemio-e72b0cb261b5fc9c70a839882ea07160ef7ef424.zip | |
feat(web): Replace NextAuth with Supabase Auth
Diffstat (limited to 'packages/web/src/app/api/auth')
| -rw-r--r-- | packages/web/src/app/api/auth/[...nextauth]/route.ts | 3 | ||||
| -rw-r--r-- | packages/web/src/app/api/auth/callback/route.ts | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/packages/web/src/app/api/auth/[...nextauth]/route.ts b/packages/web/src/app/api/auth/[...nextauth]/route.ts deleted file mode 100644 index 8e8302c..0000000 --- a/packages/web/src/app/api/auth/[...nextauth]/route.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { handlers } from "~/server/auth"; - -export const { GET, POST } = handlers; diff --git a/packages/web/src/app/api/auth/callback/route.ts b/packages/web/src/app/api/auth/callback/route.ts new file mode 100644 index 0000000..3d02db4 --- /dev/null +++ b/packages/web/src/app/api/auth/callback/route.ts @@ -0,0 +1,16 @@ +import { NextResponse } from "next/server"; +import { createClient } from "~/lib/supabase/server"; + +export async function GET(request: Request) { + const requestUrl = new URL(request.url); + const code = requestUrl.searchParams.get("code"); + const origin = requestUrl.origin; + + if (code) { + const supabase = await createClient(); + + await supabase.auth.exchangeCodeForSession(code); + } + + return NextResponse.redirect(`${origin}/`); +} |