Files
klz-cables.com/.pnpm-store/v10/files/a2/7063e304c897cf4fe3a34a114bf507d042fdf4c6646154c2fc53935384d0ae449a17f113fd07b0782ee6724308b82ae5bb128c6bf0457d12909b229c149a2a
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

29 lines
985 B
Plaintext

import { generatePayloadCookie, isolateObjectProperty, loginOperation } from 'payload';
export function login(collection) {
async function resolver(_, args, context) {
const options = {
collection,
data: {
email: args.email,
password: args.password,
username: args.username
},
depth: 0,
req: isolateObjectProperty(context.req, 'transactionID')
};
const result = await loginOperation(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=login.js.map