diff --git a/apps/app-portal/src/app/(applicant)/layout.tsx b/apps/app-portal/src/app/(applicant)/layout.tsx new file mode 100644 index 00000000..49118d36 --- /dev/null +++ b/apps/app-portal/src/app/(applicant)/layout.tsx @@ -0,0 +1 @@ +//applicant shell (header, user menu); placeholder session check diff --git a/apps/app-portal/src/app/(landing)/page.tsx b/apps/app-portal/src/app/(landing)/page.tsx index 71326ebb..0756f626 100644 --- a/apps/app-portal/src/app/(landing)/page.tsx +++ b/apps/app-portal/src/app/(landing)/page.tsx @@ -3,3 +3,4 @@ import React from "react"; export default function Page(): JSX.Element { return <>poop; } +//TODO: update to redirect authed users to /dashboard diff --git a/apps/app-portal/src/app/api/auth/[...nextauth]/route.ts b/apps/app-portal/src/app/api/auth/[...nextauth]/route.ts new file mode 100644 index 00000000..43e963af --- /dev/null +++ b/apps/app-portal/src/app/api/auth/[...nextauth]/route.ts @@ -0,0 +1,10 @@ +//NextAuth handler, email provider + Mongo adapter wired up +import { NextResponse } from "next/server"; + +export async function GET() { + return NextResponse.json({ error: "not implemented" }, { status: 501 }); +} + +export async function POST() { + return NextResponse.json({ error: "not implemented" }, { status: 501 }); +} diff --git a/apps/app-portal/src/app/api/v1/user/route.ts b/apps/app-portal/src/app/api/v1/user/route.ts new file mode 100644 index 00000000..5b2c78c1 --- /dev/null +++ b/apps/app-portal/src/app/api/v1/user/route.ts @@ -0,0 +1,6 @@ +//GET current session user; returns 401 if no session +import { NextResponse } from "next/server"; + +export async function GET() { + return NextResponse.json({ error: "not implemented" }, { status: 501 }); +} diff --git a/apps/app-portal/src/app/auth/error/page.tsx b/apps/app-portal/src/app/auth/error/page.tsx new file mode 100644 index 00000000..d7becd41 --- /dev/null +++ b/apps/app-portal/src/app/auth/error/page.tsx @@ -0,0 +1,6 @@ +//auth error display (callback errors, expired links, etc.) +import React from "react"; + +export default function Page(): JSX.Element { + return <>hay is for horses; +} diff --git a/apps/app-portal/src/app/auth/signin/page.tsx b/apps/app-portal/src/app/auth/signin/page.tsx new file mode 100644 index 00000000..1581c4dd --- /dev/null +++ b/apps/app-portal/src/app/auth/signin/page.tsx @@ -0,0 +1,6 @@ +//magic-link email entry form +import React from "react"; + +export default function Page(): JSX.Element { + return <>hay is for horses; +} diff --git a/apps/app-portal/src/app/auth/verify-request/page.tsx b/apps/app-portal/src/app/auth/verify-request/page.tsx new file mode 100644 index 00000000..b617d16f --- /dev/null +++ b/apps/app-portal/src/app/auth/verify-request/page.tsx @@ -0,0 +1,6 @@ +//"Check your email" confirmation screen +import React from "react"; + +export default function Page(): JSX.Element { + return <>hay is for horses; +} diff --git a/apps/app-portal/src/components/auth/SignInForm.tsx b/apps/app-portal/src/components/auth/SignInForm.tsx new file mode 100644 index 00000000..e2e9d3b7 --- /dev/null +++ b/apps/app-portal/src/components/auth/SignInForm.tsx @@ -0,0 +1,6 @@ +//email input form, calls signIn("email") +import React from "react"; + +export default function Page(): JSX.Element { + return <>hay is for horses; +} diff --git a/apps/app-portal/src/components/auth/UserMenu.tsx b/apps/app-portal/src/components/auth/UserMenu.tsx new file mode 100644 index 00000000..6a1ef75f --- /dev/null +++ b/apps/app-portal/src/components/auth/UserMenu.tsx @@ -0,0 +1,6 @@ +//avatar + sign-out dropdown for header +import React from "react"; + +export default function Page(): JSX.Element { + return <>hay is for horses; +} diff --git a/apps/app-portal/src/components/ui/input.tsx b/apps/app-portal/src/components/ui/input.tsx index 5aa8417b..8232fc2d 100644 --- a/apps/app-portal/src/components/ui/input.tsx +++ b/apps/app-portal/src/components/ui/input.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/prop-types */ import * as React from "react"; import { cn } from "@/lib/utils"; diff --git a/apps/app-portal/src/components/ui/table.tsx b/apps/app-portal/src/components/ui/table.tsx index 456c900b..9faa08d8 100644 --- a/apps/app-portal/src/components/ui/table.tsx +++ b/apps/app-portal/src/components/ui/table.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/prop-types */ import * as React from "react"; /* eslint-disable react/prop-types */ diff --git a/apps/app-portal/src/lib/auth/adapter.ts b/apps/app-portal/src/lib/auth/adapter.ts new file mode 100644 index 00000000..99ffe3d6 --- /dev/null +++ b/apps/app-portal/src/lib/auth/adapter.ts @@ -0,0 +1 @@ +//Mongo adapter instance diff --git a/apps/app-portal/src/lib/auth/config.ts b/apps/app-portal/src/lib/auth/config.ts new file mode 100644 index 00000000..455732a2 --- /dev/null +++ b/apps/app-portal/src/lib/auth/config.ts @@ -0,0 +1 @@ +//NextAuth options (providers, callbacks, session strategy) diff --git a/apps/app-portal/src/lib/auth/email-transport.ts b/apps/app-portal/src/lib/auth/email-transport.ts new file mode 100644 index 00000000..4814ab98 --- /dev/null +++ b/apps/app-portal/src/lib/auth/email-transport.ts @@ -0,0 +1 @@ +//Nodemailer transport stub for magic-link emails diff --git a/apps/app-portal/src/lib/auth/guards.ts b/apps/app-portal/src/lib/auth/guards.ts new file mode 100644 index 00000000..0ceda79a --- /dev/null +++ b/apps/app-portal/src/lib/auth/guards.ts @@ -0,0 +1 @@ +//requireUser() and requireAdmin() helpers for route handlers diff --git a/apps/app-portal/src/lib/auth/session.ts b/apps/app-portal/src/lib/auth/session.ts new file mode 100644 index 00000000..a2f7175e --- /dev/null +++ b/apps/app-portal/src/lib/auth/session.ts @@ -0,0 +1 @@ +//server-side getSession() helper for RSCs diff --git a/apps/app-portal/src/middleware.ts b/apps/app-portal/src/middleware.ts new file mode 100644 index 00000000..7ae3dd9f --- /dev/null +++ b/apps/app-portal/src/middleware.ts @@ -0,0 +1,12 @@ +//Next middleware, redirects unauthed users from protected routes +import { NextResponse } from "next/server"; +// import type { NextRequest } from "next/server"; + +export default function middleware() { + //_request: NextRequest + return NextResponse.next(); +} + +export const config = { + matcher: [], +};