Optionaloptions: ProtectOptionsOptional configuration for redirect behavior (for example, return URL or sign-in parameters).
Resolves if the user is authenticated; otherwise triggers a redirect.
import { protect } from "@monocloud/auth-nextjs";
export default async function Home() {
await protect();
return <>You are signed in.</>;
}
Ensures the current user is authenticated. If not, redirects to the sign-in flow.