diff --git a/teressa-copeland-homes/src/app/agent/dashboard/page.tsx b/teressa-copeland-homes/src/app/agent/dashboard/page.tsx new file mode 100644 index 0000000..c07d97e --- /dev/null +++ b/teressa-copeland-homes/src/app/agent/dashboard/page.tsx @@ -0,0 +1,17 @@ +import { auth } from "@/lib/auth"; +import { redirect } from "next/navigation"; + +export default async function DashboardPage() { + // Defense-in-depth session check (layout also checks, this is belt-and-suspenders) + const session = await auth(); + if (!session) redirect("/agent/login"); + + return ( +
+

Dashboard

+

+ Welcome back, {session.user?.email}. Portal content coming in Phase 3. +

+
+ ); +} diff --git a/teressa-copeland-homes/src/app/agent/layout.tsx b/teressa-copeland-homes/src/app/agent/layout.tsx new file mode 100644 index 0000000..a521b11 --- /dev/null +++ b/teressa-copeland-homes/src/app/agent/layout.tsx @@ -0,0 +1,26 @@ +import { auth } from "@/lib/auth"; +import { redirect } from "next/navigation"; +import { LogoutButton } from "@/components/ui/LogoutButton"; + +export default async function AgentLayout({ + children, +}: { + children: React.ReactNode; +}) { + // Defense-in-depth: middleware handles most cases, this catches edge cases + const session = await auth(); + if (!session) redirect("/agent/login"); + + return ( +
+
+ Agent Portal +
+ {session.user?.email} + +
+
+
{children}
+
+ ); +} diff --git a/teressa-copeland-homes/src/app/page.tsx b/teressa-copeland-homes/src/app/page.tsx index 3f36f7c..098c316 100644 --- a/teressa-copeland-homes/src/app/page.tsx +++ b/teressa-copeland-homes/src/app/page.tsx @@ -1,65 +1,11 @@ -import Image from "next/image"; - -export default function Home() { +export default function HomePage() { return ( -
-
- Next.js logo -
-

- To get started, edit the page.tsx file. -

-

- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -

-
-
- - Vercel logomark - Deploy Now - - - Documentation - -
-
-
+
+
+

Teressa Copeland Homes

+

Real estate expertise for Utah home buyers and sellers.

+

Marketing site coming in Phase 2.

+
+
); } diff --git a/teressa-copeland-homes/src/components/ui/LogoutButton.tsx b/teressa-copeland-homes/src/components/ui/LogoutButton.tsx new file mode 100644 index 0000000..9e9a1c9 --- /dev/null +++ b/teressa-copeland-homes/src/components/ui/LogoutButton.tsx @@ -0,0 +1,19 @@ +import { signOut } from "@/lib/auth"; + +async function logoutAction() { + "use server"; + await signOut({ redirectTo: "/agent/login?signed_out=1" }); +} + +export function LogoutButton() { + return ( +
+ +
+ ); +}