Files
klz-cables.com/.pnpm-store/v10/files/1e/e6759bec94e35e17d0ee4bed7e6c8f13f4122bf9333087cc7802b7051b5325775a98c86f438b0258a8fb04b0886741ae3bcf4ed3c613a3ab03c261fefc7b72
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

32 lines
1.1 KiB
Plaintext

import { generatePayloadCookie, isolateObjectProperty, resetPasswordOperation } from 'payload';
export function resetPassword(collection) {
async function resolver(_, args, context) {
if (args.locale) {
context.req.locale = args.locale;
}
if (args.fallbackLocale) {
context.req.fallbackLocale = args.fallbackLocale;
}
const options = {
api: 'GraphQL',
collection,
data: args,
depth: 0,
req: isolateObjectProperty(context.req, 'transactionID')
};
const result = await resetPasswordOperation(options);
const cookie = generatePayloadCookie({
collectionAuthConfig: collection.config.auth,
cookiePrefix: context.req.payload.config.cookiePrefix,
token: result.token
});
context.headers['Set-Cookie'] = cookie;
if (collection.config.auth.removeTokenFromResponses) {
delete result.token;
}
return result;
}
return resolver;
}
//# sourceMappingURL=resetPassword.js.map