beta/middleware.ts
Christopher Arraya 53c3cd3d6e initial commit
2023-11-04 14:57:25 -04:00

13 lines
423 B
TypeScript

import { createMiddlewareClient } from "@supabase/auth-helpers-nextjs";
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
import type { Database } from "@/types/supabase";
export async function middleware(req: NextRequest) {
const res = NextResponse.next();
const supabase = createMiddlewareClient<Database>({ req, res });
await supabase.auth.getSession();
return res;
}