Files
klz-cables.com/.pnpm-store/v10/files/74/fb101c9a6f437a5b532b0337f982f25c56a80605671a18bef7187325ff4a0f4e005c791bb1882ba3390c4bfe71b85b634037f2c278c6933afce6d7a475bd18
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

34 lines
1.1 KiB
Plaintext

import { logError } from '../utilities/logError.js';
import { mergeHeaders } from '../utilities/mergeHeaders.js';
export const executeAuthStrategies = async (args)=>{
let result = {
user: null
};
if (!args.payload.authStrategies?.length) {
return result;
}
for (const strategy of args.payload.authStrategies){
// add the configured AuthStrategy `name` to the strategy function args
args.strategyName = strategy.name;
args.isGraphQL = Boolean(args.isGraphQL);
args.canSetHeaders = Boolean(args.canSetHeaders);
try {
const authResult = await strategy.authenticate(args);
if (authResult.responseHeaders) {
authResult.responseHeaders = mergeHeaders(result.responseHeaders || new Headers(), authResult.responseHeaders || new Headers());
}
result = authResult;
} catch (err) {
logError({
err,
payload: args.payload
});
}
if (result.user) {
return result;
}
}
return result;
};
//# sourceMappingURL=executeAuthStrategies.js.map