GET still shows a one-button page, a used invitation can resend or reopen for the signed-in invitee, and an email-change GET no longer signs the account out.
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import { Suspense } from "react";
|
|
import { useSearchParams } from "next/navigation";
|
|
import { useTranslation } from "../../../contexts/MessagesContext";
|
|
import { magicLinkVerifyPath } from "../../../../lib/create/confirmLinkPaths";
|
|
import { ConfirmLinkScreen } from "../../_components/ConfirmLinkScreen";
|
|
|
|
function LoginConfirmFallback() {
|
|
const t = useTranslation("pages.login");
|
|
return (
|
|
<div className="flex min-h-[100dvh] items-center justify-center bg-[var(--color-surface-invert-brand-primary)]">
|
|
<p className="text-[14px] text-[var(--color-content-default-primary)]">
|
|
{t("loadingFallback")}
|
|
</p>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function LoginConfirmWithParams() {
|
|
const t = useTranslation("pages.login");
|
|
const searchParams = useSearchParams();
|
|
const token = searchParams.get("token") ?? "";
|
|
|
|
return (
|
|
<ConfirmLinkScreen
|
|
title={t("confirmTitle")}
|
|
description={t("confirmDescription")}
|
|
buttonLabel={t("confirmButton")}
|
|
action={magicLinkVerifyPath(token)}
|
|
token={token}
|
|
backHref="/"
|
|
backLabel={t("backToHome")}
|
|
missingTitle={t("confirmMissingTitle")}
|
|
missingDescription={t("confirmMissingDescription")}
|
|
missingHref="/login"
|
|
missingButtonLabel={t("confirmMissingButton")}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default function LoginConfirmPage() {
|
|
return (
|
|
<Suspense fallback={<LoginConfirmFallback />}>
|
|
<LoginConfirmWithParams />
|
|
</Suspense>
|
|
);
|
|
}
|