- Name
- {user.name}
- {user.email}
- Created
- {createdAt}
"use client";
import { useAuth } from "@farm.js/auth/client";
import { useEffect } from "react";
import { SignOutButton } from "../../components/sign-out-button";
import { SiteHeader } from "../../components/site-header";
export default function DashboardPage() {
const { isPending, session, user } = useAuth();
useEffect(() => {
if (!isPending && !user) {
window.location.replace("/sign-in");
}
}, [isPending, user]);
if (isPending) {
return (
Returning you to the sign-in pageā¦
Farm route middleware verified your session before this dashboard loaded.
httpOnly cookie
Set the production FARMJS Auth URL, secret, and database URL in your host.
Run the FARMJS Auth migration command before serving production traffic.
Build your first protected feature beside this dashboard route.