Render textured aerial maps and support legacy recovery links
This commit is contained in:
9
proxy.ts
9
proxy.ts
@@ -1,6 +1,15 @@
|
||||
import { createServerClient } from "@supabase/ssr";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { legacyRecoveryToken } from "./shared/legacy-recovery";
|
||||
export async function proxy(request: NextRequest) {
|
||||
const recoveryToken = legacyRecoveryToken(request.nextUrl.pathname);
|
||||
if (recoveryToken) {
|
||||
const destination = request.nextUrl.clone();
|
||||
destination.pathname = "/auth/callback";
|
||||
destination.search = "";
|
||||
destination.searchParams.set("legacy_recovery_token", recoveryToken);
|
||||
return NextResponse.redirect(destination);
|
||||
}
|
||||
let response = NextResponse.next({ request });
|
||||
if (!process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY) return response;
|
||||
const client = createServerClient(
|
||||
|
||||
Reference in New Issue
Block a user