The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix(ui library): fix redirects (#36118)
Charis62fbe17a5e8c
diff --git a/apps/ui-library/registry/default/blocks/password-based-auth-nextjs/app/auth/confirm/route.ts b/apps/ui-library/registry/default/blocks/password-based-auth-nextjs/app/auth/confirm/route.tsindex 141bec92115..bfcd61eabc9 100644--- a/apps/ui-library/registry/default/blocks/password-based-auth-nextjs/app/auth/confirm/route.ts+++ b/apps/ui-library/registry/default/blocks/password-based-auth-nextjs/app/auth/confirm/route.ts@@ -7,7 +7,8 @@ export async function GET(request: NextRequest) {const { searchParams } = new URL(request.url)const token_hash = searchParams.get('token_hash')const type = searchParams.get('type') as EmailOtpType | null- const next = searchParams.get('next') ?? '/'+ const _next = searchParams.get('next')+ const next = _next?.startsWith('/') ? _next : '/'if (token_hash && type) {const supabase = await createClient()diff --git a/apps/ui-library/registry/default/blocks/password-based-auth-react-router/app/routes/auth.confirm.tsx b/apps/ui-library/registry/default/blocks/password-based-auth-react-router/app/routes/auth.confirm.tsxindex 41425222c4f..37c751afc31 100644--- a/apps/ui-library/registry/default/blocks/password-based-auth-react-router/app/routes/auth.confirm.tsx+++ b/apps/ui-library/registry/default/blocks/password-based-auth-react-router/app/routes/auth.confirm.tsx@@ -6,7 +6,8 @@ export async function loader({ request }: LoaderFunctionArgs) {const requestUrl = new URL(request.url)const token_hash = requestUrl.searchParams.get('token_hash')const type = requestUrl.searchParams.get('type') as EmailOtpType | null- const next = requestUrl.searchParams.get('next') || '/'+ const _next = requestUrl.searchParams.get('next')+ const next = _next?.startsWith('/') ? _next : '/'if (token_hash && type) {const { supabase, headers } = createClient(request)diff --git a/apps/ui-library/registry/default/blocks/password-based-auth-tanstack/routes/auth/confirm.ts b/apps/ui-library/registry/default/blocks/password-based-auth-tanstack/routes/auth/confirm.tsindex 8e72087fc68..dcc07af3a14 100644--- a/apps/ui-library/registry/default/blocks/password-based-auth-tanstack/routes/auth/confirm.ts+++ b/apps/ui-library/registry/default/blocks/password-based-auth-tanstack/routes/auth/confirm.ts@@ -27,7 +27,8 @@ const confirmFn = createServerFn({ method: 'GET' })const searchParams = ctx.dataconst token_hash = searchParams['token_hash'] as stringconst type = searchParams['type'] as EmailOtpType | null- const next = (searchParams['next'] ?? '/') as string+ const _next = searchParams['next'] as string+ const next = _next?.startsWith('/') ? _next : '/'if (token_hash && type) {const supabase = createClient()diff --git a/apps/ui-library/registry/default/blocks/social-auth-react-router/app/routes/auth.oauth.tsx b/apps/ui-library/registry/default/blocks/social-auth-react-router/app/routes/auth.oauth.tsxindex cfe4dd1fd19..22da5434422 100644--- a/apps/ui-library/registry/default/blocks/social-auth-react-router/app/routes/auth.oauth.tsx+++ b/apps/ui-library/registry/default/blocks/social-auth-react-router/app/routes/auth.oauth.tsx@@ -4,7 +4,8 @@ import { type LoaderFunctionArgs, redirect } from 'react-router'export async function loader({ request }: LoaderFunctionArgs) {const requestUrl = new URL(request.url)const code = requestUrl.searchParams.get('code')- const next = requestUrl.searchParams.get('next') || '/'+ const _next = requestUrl.searchParams.get('next')+ const next = _next?.startsWith('/') ? _next : '/'if (code) {const { supabase, headers } = createClient(request)diff --git a/apps/ui-library/registry/default/blocks/social-auth-tanstack/routes/auth/oauth.ts b/apps/ui-library/registry/default/blocks/social-auth-tanstack/routes/auth/oauth.tsindex 8e72087fc68..2996a594a65 100644--- a/apps/ui-library/registry/default/blocks/social-auth-tanstack/routes/auth/oauth.ts+++ b/apps/ui-library/registry/default/blocks/social-auth-tanstack/routes/auth/oauth.ts@@ -27,7 +27,8 @@ const confirmFn = createServerFn({ method: 'GET' })const searchParams = ctx.dataconst token_hash = searchParams['token_hash'] as stringconst type = searchParams['type'] as EmailOtpType | null- const next = (searchParams['next'] ?? '/') as string+ const _next = (searchParams['next'] ?? '/') as string+ const next = _next?.startsWith('/') ? _next : '/'if (token_hash && type) {const supabase = createClient()