Adds bcrypt native binding for better login performance (#2549)

* Adds bcrypt native binding for better login performance

* Swaps bcrypt-nodejs for bcryptjs as compatible with bcrypt native

* Fixes package versions
This commit is contained in:
Florent Vilmart
2016-08-19 16:53:57 -04:00
committed by Drew
parent 9429659d90
commit 3a08ec9ce8
3 changed files with 24 additions and 5 deletions

View File

@@ -77,7 +77,18 @@ describe('Auth', () => {
auth.getUserRoles()
.then((roles) => expect(roles).toEqual([]))
.then(() => done());
})
});
it('should properly handle bcrypt upgrade', (done) => {
var bcryptOriginal = require('bcrypt-nodejs');
var bcryptNew = require('bcryptjs');
bcryptOriginal.hash('my1Long:password', null, null, function(err, res) {
bcryptNew.compare('my1Long:password', res, function(err, res) {
expect(res).toBeTruthy();
done();
})
});
});
});
});