add sign in redirect

This commit is contained in:
2026-03-28 16:01:42 -05:00
parent c2fd58bed4
commit 0f531f771b

View File

@@ -1,14 +1,26 @@
import type { Metadata } from 'next';
import { redirect } from 'next/navigation';
import { isAuthenticatedNextjs } from '@convex-dev/auth/nextjs/server';
export const generateMetadata = (): Metadata => {
return {
title: 'Profile',
robots: {
index: false,
follow: false,
googleBot: {
index: false,
follow: false,
},
},
};
};
const ProfileLayout = ({
const ProfileLayout = async ({
children,
}: Readonly<{ children: React.ReactNode }>) => {
if (!(await isAuthenticatedNextjs()))
redirect('/sign-in');
return <>{children}</>;
};
export default ProfileLayout;