Explain a dead share link and a broken invite in the reader's terms

A practice opening an expired or revoked share link met the app's own
404, 'this page does not exist', with a button to a dashboard it has no
account for. The share segment now has its own not-found page: link
expired or invalid, ask the person who shared it for a new one, and no
link anywhere. It still answers 404 for every failure class alike.

A malformed invite link fell through to the plain registration form.
It now says the invitation is invalid and offers sign-in; the shape
check is public, so this reveals nothing about which tokens exist, and
a well-formed token still goes on to registration.
This commit is contained in:
Marc-André Bombeck committed 2026-10-08 18:55:45 +02:00
1 parent 005cb32ea8
commit f944c07cdf
10 files changed
+167 -15

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
import { LinkIcon } from "lucide-react";
import { resolveShareViewLocale } from "@/lib/clinician-share/request-locale";
import { getServerTranslator } from "@/lib/i18n/server-translator";
/**
* What a practice sees when a shared link no longer opens: expired, revoked,
* mistyped. The page still answers 404 for every failure class alike (the
* share page's `notFound()`), so a probe learns nothing from it; what changes
* is the copy. The app's own 404 said "this page does not exist" and offered
* a dashboard the reader has no account for. This one says what happened in
* the reader's terms and what to do, and links nowhere.
*/
export default async function ClinicianShareNotFound() {
const locale = await resolveShareViewLocale();
const { t } = getServerTranslator(locale);
return (
<main
id="main-content"
data-slot="clinician-share-unavailable"
className="bg-background text-foreground flex min-h-dvh flex-col items-center justify-center gap-6 px-4 py-12 pt-[calc(env(safe-area-inset-top)+3rem)]"
>
<div
aria-hidden="true"
className="bg-muted text-muted-foreground flex size-14 items-center justify-center rounded-xl"
>
<LinkIcon className="size-6" />
</div>
<div className="max-w-md space-y-2 text-center">
<h1 className="text-2xl font-bold tracking-tight">
{t("clinicianView.unavailable.title")}
</h1>
<p className="text-foreground text-sm">
{t("clinicianView.unavailable.description")}
</p>
</div>
</main>
);
}