Files
klz-cables.com/.pnpm-store/v10/files/1c/7b48ccd009c23b892a05f2f5aa9c9d276347a34f3c48ebc17b84eeee7565224c0d3582ea9a468851ddd728e8e0139452a05d88a96c540bb36a235bd0b02465
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.4 KiB
Plaintext

import { status as httpStatus } from 'http-status';
import { getRequestCollection } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { generatePayloadCookie } from '../cookies.js';
import { resetPasswordOperation } from '../operations/resetPassword.js';
export const resetPasswordHandler = async (req)=>{
const collection = getRequestCollection(req);
const { searchParams, t } = req;
const depth = searchParams.get('depth');
const result = await resetPasswordOperation({
collection,
data: {
password: typeof req.data?.password === 'string' ? req.data.password : '',
token: typeof req.data?.token === 'string' ? req.data.token : ''
},
depth: depth ? Number(depth) : undefined,
req
});
const cookie = generatePayloadCookie({
collectionAuthConfig: collection.config.auth,
cookiePrefix: req.payload.config.cookiePrefix,
token: result.token
});
if (collection.config.auth.removeTokenFromResponses) {
delete result.token;
}
return Response.json({
message: t('authentication:passwordResetSuccessfully'),
...result
}, {
headers: headersWithCors({
headers: new Headers({
'Set-Cookie': cookie
}),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=resetPassword.js.map