mirror of
https://github.com/bitbaum/vitareba.git
synced 2026-12-04 05:37:46 +01:00
* fix(auth): unblock the public API surface — login was unreachable in prod The middleware session-gated ALL of /api, so every anonymous endpoint 307-redirected to the login page: the NextAuth session + credentials callback (login itself), registration, password reset, the assessment- leads funnel, and the Calendly webhook. Signed-in traffic looked healthy, so nothing caught it. - PUBLIC_API_PREFIXES in lib/config/routes.ts (SSOT) — each listed prefix authenticates itself (NextAuth, HMAC signature, CRON_SECRET, or Zod-validated no-PII writes) - gated /api paths now answer 401 JSON instead of an HTML login page - new /api/health (fleet convention): 200 = app up + DB reachable - route-auth-invariant.test.ts pins the class: every route under a public prefix must self-authenticate; every gated route must import a guard Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor: delete the dead unlocalized auth tree + audit fixes next-intl (localePrefix: always) redirects /login -> /de/login, so the app/(auth) tree never rendered — a full duplicate of the localized auth pages, drifting separately (hardcoded English, stale styles). Deleted. Its stylesheet WAS live (portal forms imported it): the shared form primitives now live once in app/forms.module.css; auth.module.css re-exports them via composes. Also from the audit sweep: - public/robots.txt deleted — it shadowed app/robots.ts, so the portal/admin/api disallow rules never shipped - portal nav labels: one SSOT (PORTAL_ROUTE_LABELS) for PortalNav and NavBreadcrumb — breadcrumb was silently blank on /goals and /documents because the two copies had drifted - global 404 now links to the public homepage, not the auth-gated dashboard - manifest icons existed only as references: generated icon-192/512.png from the brand mark (404'd on every page load before) - Google auth provider only registers when its env is configured - dead SignOutButton component + create-next-app template SVGs removed - drop package.json pnpm.onlyBuiltDependencies (moved to pnpm-workspace.yaml allowBuilds long ago; pnpm warned on every run) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ui): admin patient page 500, dead mobile CSS, and portal polish - schema: documents<->users is doubly connected (owner + uploader); the unnamed primary relation made Drizzle throw at query time and the admin patient-detail page — the core clinical view — 500'd in prod. Both sides now carry relationName. lib/db/relations.test.ts plans a query over EVERY declared relation so the next misconfigured relation (this was the second) fails in CI, not in prod. - admin.module.css: the entire mobile @media block sat BEFORE the base rules it overrides (appended later), so phones got the desktop layout — 4-across stat tiles clipping their labels, oversized title, no form-grid collapse. Block moved after its base rules; lib/css-order.test.ts now fails any stylesheet where a base rule shadows an earlier @media override. - proxy: admins landing on /dashboard (post-login default, PWA start_url) are redirected to /admin/patients — they were dropped into the empty patient portal. - check-in scale: hovering the button just clicked painted the number teal-on-teal (.scaleBtn:hover outranked .scaleBtnActive) - admin assessment-trend chart plotted newest-first — time axis read right-to-left; reversed to chronological - sidebar wordmark was ink-on-ink (only 'Re' visible): Logo gains a 'bright' on-dark variant, used by portal + admin sidebars Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
70 lines
1.5 KiB
CSS
70 lines
1.5 KiB
CSS
/* ─── Shared form primitives ─────────────────────────────────────────────────
|
|
SSOT for the field/label/input/submit look used by BOTH the auth pages
|
|
(app/[locale]/(auth)/*) and portal forms (bookings, messages, profile).
|
|
auth.module.css re-exports these via `composes` so auth pages keep a single
|
|
styles import. */
|
|
|
|
.field {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.4rem;
|
|
}
|
|
|
|
.label {
|
|
font-size: 0.68rem;
|
|
letter-spacing: 0.1em;
|
|
text-transform: uppercase;
|
|
color: var(--ink2);
|
|
font-weight: 400;
|
|
}
|
|
|
|
.input {
|
|
padding: 0.7rem 0;
|
|
border: none;
|
|
border-bottom: 1.5px solid var(--border);
|
|
border-radius: 0;
|
|
font-size: 0.95rem;
|
|
font-family: inherit;
|
|
color: var(--ink);
|
|
background: transparent;
|
|
transition: border-color var(--transition-fast);
|
|
min-height: 2.75rem;
|
|
}
|
|
|
|
.input:focus {
|
|
outline: none;
|
|
border-bottom-color: var(--teal);
|
|
}
|
|
|
|
.input::placeholder {
|
|
color: var(--faint);
|
|
}
|
|
|
|
.submit {
|
|
margin-top: 0.75rem;
|
|
padding: 0.85rem 1.5rem;
|
|
background: var(--ink);
|
|
color: var(--white);
|
|
border: none;
|
|
border-radius: 0;
|
|
font-family: var(--font-dm-sans), sans-serif;
|
|
font-size: 0.75rem;
|
|
letter-spacing: 0.12em;
|
|
text-transform: uppercase;
|
|
cursor: pointer;
|
|
width: 100%;
|
|
min-height: 2.75rem;
|
|
transition: background var(--transition-fast);
|
|
}
|
|
|
|
.submit:hover,
|
|
.submit:focus-visible {
|
|
background: var(--teal);
|
|
outline: none;
|
|
}
|
|
|
|
.submit:disabled {
|
|
opacity: 0.5;
|
|
cursor: default;
|
|
}
|