19 lines
354 B
TypeScript
Raw Normal View History

2024-05-24 17:57:03 -04:00
import { createClient } from "@/utils/supabase/server";
import { redirect } from "next/navigation";
export default async function ProtectedPage() {
const supabase = createClient();
const {
data: { user },
} = await supabase.auth.getUser();
if (!user) {
return redirect("/login");
}
return (
<h1>This is protected.</h1>
2024-05-24 17:57:03 -04:00
);
}