fix(01-02): move onboarding/pet outside (app) group — breaks redirect loop
This commit is contained in:
1 parent
d6fc3e5ccf
commit
32226739b7
1 file changed
+11
-11
@@ -1,19 +1,19 @@
|
||||
import { auth } from "@clerk/nextjs/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
/**
|
||||
* Onboarding pet page — /onboarding/pet
|
||||
*
|
||||
* Landing page shown when an authenticated owner has no pets yet.
|
||||
* The app shell layout.tsx redirects here when pets.length === 0.
|
||||
* Shown when an authenticated owner has no pets yet.
|
||||
* Lives OUTSIDE the (app) layout group to avoid the redirect loop:
|
||||
* app layout sees 0 pets → redirects here → this page has no pet check.
|
||||
*
|
||||
* UI-SPEC: Pet Profile Screens — Create First Pet (onboarding)
|
||||
* - Heading: "Add your first pet" (text-xl font-semibold)
|
||||
* - Subheading: "Your pet will be their own star on OnlyPets." (text-sm text-muted-foreground)
|
||||
* - PetForm placeholder (wired in Plan 03)
|
||||
*
|
||||
* This page is intentionally outside the (app) layout's pet-list check —
|
||||
* owners are redirected HERE when they have no pets, so the shell must
|
||||
* render without requiring an existing pet.
|
||||
* PetForm is wired in Plan 03.
|
||||
*/
|
||||
export default function OnboardingPetPage() {
|
||||
export default async function OnboardingPetPage() {
|
||||
const { userId } = await auth();
|
||||
if (!userId) redirect("/log-in");
|
||||
|
||||
return (
|
||||
<main className="min-h-screen flex items-center justify-center bg-background px-4">
|
||||
<div className="w-full max-w-[512px]">
|
||||
Reference in new issue
Block a user