Goal
Create all files for the Auth & Session Foundation feature. No real logic yet, just have stubs only. Goal is for everything to compile, pages to render placeholders, and the contract doc to be filled in.
This ticket also creates the shared (applicant) layout file that other applicant-facing tickets will rely on.
Folders to create
Files to create
Routes
Library
Components
Middleware
Acceptance criteria
Goal
Create all files for the Auth & Session Foundation feature. No real logic yet, just have stubs only. Goal is for everything to compile, pages to render placeholders, and the contract doc to be filled in.
This ticket also creates the shared
(applicant)layout file that other applicant-facing tickets will rely on.Folders to create
src/app/auth/signin/src/app/auth/verify-request/src/app/auth/error/src/app/api/auth/[...nextauth]/src/app/api/v1/user/src/lib/auth/src/components/auth/Files to create
Routes
src/app/(applicant)/layout.tsx— applicant shell (header, user menu); placeholder session check,src/app/(landing)/page.tsx— already exists; update to redirect authed users to/dashboardsrc/app/auth/signin/page.tsx— magic-link email entry formsrc/app/auth/verify-request/page.tsx— "Check your email" confirmation screensrc/app/auth/error/page.tsx— auth error display (callback errors, expired links, etc.)src/app/api/auth/[...nextauth]/route.ts— NextAuth handler, email provider + Mongo adapter wired upsrc/app/api/v1/user/route.ts—GETcurrent session user; returns 401 if no sessionLibrary
src/lib/auth/config.ts— NextAuth options (providers, callbacks, session strategy)src/lib/auth/adapter.ts— Mongo adapter instancesrc/lib/auth/session.ts— server-sidegetSession()helper for RSCssrc/lib/auth/guards.ts—requireUser()andrequireAdmin()helpers for route handlerssrc/lib/auth/email-transport.ts— Nodemailer transport stub for magic-link emailsComponents
src/components/auth/SignInForm.tsx— email input form, callssignIn("email")src/components/auth/UserMenu.tsx— avatar + sign-out dropdown for headerMiddleware
src/middleware.ts— Next middleware, redirects unauthed users from protected routesAcceptance criteria
yarn buildsucceeds.NextResponse.json({ error: 'not implemented' }, { status: 501 }).