Require logon for Zone pages

This commit is contained in:
Timothy Armes
2024-10-21 15:19:28 +02:00
parent 9e9f5fd975
commit 50943685c0
10 changed files with 155 additions and 90 deletions
-2
View File
@@ -41,8 +41,6 @@ export const pathnames = {
fr: "/contactez-nous",
en: "/contact-us",
},
"[...rest]": "[...rest]",
} satisfies Pathnames<typeof locales>;
export const { Link, redirect, usePathname, useRouter, getPathname } =
+7 -3
View File
@@ -133,16 +133,20 @@ export default function Nodemailer(
maxAge: 24 * 60 * 60,
async sendVerificationRequest(params) {
const { identifier, url, provider } = params;
let locale = "fr";
const { searchParams } = new URL(params.url);
const { searchParams } = new URL(url);
if (searchParams.has("callbackUrl")) {
const { pathname } = new URL(searchParams.get("callbackUrl")!);
locale = pathname.split("/")[1];
const maybeLocale = pathname.split("/")[1];
if (["en", "fr"].includes(maybeLocale)) {
locale = maybeLocale;
}
}
const t = await getTranslations({ locale, namespace: "SignIn" });
const { identifier, url, provider } = params;
const { host } = new URL(url);
const transport = createTransport(provider.server);
const result = await transport.sendMail({