Files
klz-cables.com/.pnpm-store/v10/files/ab/5767c69c6b0d0a62b10635efaccd266c96b0402df580db45a9047a9036fc3b2752a2d08257b4d118244f5461c4e146ef58579e1582245e050e3d4cdd5080ea
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

41 lines
1.1 KiB
Plaintext

const autoRemoveVerificationToken = ({ data, operation, originalDoc, value })=>{
// If a user manually sets `_verified` to true,
// and it was `false`, set _verificationToken to `null`.
// This is useful because the admin panel
// allows users to set `_verified` to true manually
if (operation === 'update') {
if (data?._verified === true && originalDoc?._verified === false) {
return null;
}
}
return value;
};
export const verificationFields = [
{
name: '_verified',
type: 'checkbox',
access: {
create: ({ req: { user } })=>Boolean(user),
read: ({ req: { user } })=>Boolean(user),
update: ({ req: { user } })=>Boolean(user)
},
admin: {
components: {
Field: false
}
},
label: ({ t })=>t('authentication:verified')
},
{
name: '_verificationToken',
type: 'text',
hidden: true,
hooks: {
beforeChange: [
autoRemoveVerificationToken
]
}
}
];
//# sourceMappingURL=verification.js.map