Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function authenticate(params, cb) {
console.log(params);
const doubleSha = auth.doubleSha1('pass123');
const isValid = auth.verifyToken(
params.authPluginData1,
params.authPluginData2,
params.authToken,
doubleSha
);
if (isValid) {
cb(null);
} else {
// for list of codes lib/constants/errors.js
cb(null, { message: 'wrong password dude', code: 1045 });
}
}