Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function factory(req) {
const options = {};
if (req && req.url.match(/^\/challenges\/\d{8}\/review-opportunities/)) {
options.auth = getAuthTokens(req);
const challengeId = req.url.match(/\d+/)[0];
_.set(options, 'reviewOpportunity.challenge.id', challengeId);
}
return reducers.reviewOpportunity.factory(options);
}