bcrypt.js
bcrypt.js copied to clipboard
compareSync and compare not working on AWS lambda
I recently tried deploying an app using this library to aws lambda and the compareSync and compare functions didn't work, my lambda function just timed out. I'd like to believe this is due to a limitation on lambda's side but i decided to post and ask for help in case. Below is a sample of my code
const ApiBuilder = require('claudia-api-builder');
const api = new ApiBuilder();
const encryptionHelper = require('bcrypt-nodejs');
api.post('/auth/login', async function ({post:{username, password}}) {
const user = await UserModel.findOne({ username })
const pResult = encryptionHelper.compareSync(password, result.password)
if(pResult){
return 'Success'
}else{
return 'Not found'
}
})
If it helps, I am deploying with claudiajs and claudiajs api builder and i am using the current version of this library
require('bcrypt-nodejs') isn't this package