Files
klz-cables.com/.pnpm-store/v10/files/8c/811c037f1dd0407f932721d8bd13db22f257b9c66cba6be29f5edb929b98a2f5b79b28356b8b09d60ea990de20baf722719169add90591944d7802892f5652
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

71 lines
1.7 KiB
Plaintext

import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { formatAdminURL } from 'payload/shared';
import React from 'react';
import { Logo } from '../../elements/Logo/index.js';
import { ToastAndRedirect } from './index.client.js';
export const verifyBaseClass = 'verify';
export async function Verify({
initPageResult,
params,
searchParams
}) {
// /:collectionSlug/verify/:token
const [collectionSlug, verify, token] = params.segments;
const {
locale,
permissions,
req
} = initPageResult;
const {
i18n,
payload: {
config
},
payload,
user
} = req;
const {
routes: {
admin: adminRoute
},
serverURL
} = config;
let textToRender;
let isVerified = false;
try {
await req.payload.verifyEmail({
collection: collectionSlug,
token
});
isVerified = true;
textToRender = req.t('authentication:emailVerified');
} catch (e) {
textToRender = req.t('authentication:unableToVerify');
}
if (isVerified) {
return /*#__PURE__*/_jsx(ToastAndRedirect, {
message: req.t('authentication:emailVerified'),
redirectTo: formatAdminURL({
adminRoute,
path: '/login'
})
});
}
return /*#__PURE__*/_jsxs(React.Fragment, {
children: [/*#__PURE__*/_jsx("div", {
className: `${verifyBaseClass}__brand`,
children: /*#__PURE__*/_jsx(Logo, {
i18n: i18n,
locale: locale,
params: params,
payload: payload,
permissions: permissions,
searchParams: searchParams,
user: user
})
}), /*#__PURE__*/_jsx("h2", {
children: textToRender
})]
});
}
//# sourceMappingURL=index.js.map