feat(01-02): build agent portal layout, dashboard stub, and logout mechanism
- LogoutButton: client component with server action calling signOut to ?signed_out=1 - AgentLayout: defense-in-depth auth() check, header with email and sign-out button - DashboardPage: belt-and-suspenders auth() check, welcome message with agent email - HomePage: updated to Teressa Copeland Homes placeholder (Phase 2 marketing site) - npm run build and npx tsc --noEmit both pass with zero errors
This commit is contained in:
19
teressa-copeland-homes/src/components/ui/LogoutButton.tsx
Normal file
19
teressa-copeland-homes/src/components/ui/LogoutButton.tsx
Normal file
@@ -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 (
|
||||
<form action={logoutAction}>
|
||||
<button
|
||||
type="submit"
|
||||
className="text-sm text-gray-600 hover:text-gray-900 underline"
|
||||
>
|
||||
Sign out
|
||||
</button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user