Use a pure JS bcrypt
This commit is contained in:
parent
7af15ca75b
commit
159eb0076c
|
@ -7,7 +7,7 @@ var Model = require('../loopback').Model
|
|||
, path = require('path')
|
||||
, SALT_WORK_FACTOR = 10
|
||||
, crypto = require('crypto')
|
||||
, bcrypt = require('bcrypt')
|
||||
, bcrypt = require('bcryptjs')
|
||||
, passport = require('passport')
|
||||
, LocalStrategy = require('passport-local').Strategy;
|
||||
|
||||
|
@ -138,9 +138,9 @@ User.logout = function (sid, fn) {
|
|||
User.prototype.hasPassword = function (plain, fn) {
|
||||
if(this.password && plain) {
|
||||
bcrypt.compare(plain, this.password, function(err, isMatch) {
|
||||
if(err) return fn(err);
|
||||
fn(null, isMatch);
|
||||
});
|
||||
if(err) return fn(err);
|
||||
fn(null, isMatch);
|
||||
});
|
||||
} else {
|
||||
fn(null, false);
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
"loopback-datasource-juggler": "git+ssh://git@github.com:strongloop/loopback-datasource-juggler.git",
|
||||
"strong-remoting": "git+ssh://git@github.com:strongloop/strong-remoting.git",
|
||||
"inflection": "~1.2.5",
|
||||
"bcrypt": "~0.7.6",
|
||||
"passport": "~0.1.17",
|
||||
"passport-local": "~0.1.6",
|
||||
"nodemailer": "~0.4.4",
|
||||
"ejs": "~0.8.4"
|
||||
"ejs": "~0.8.4",
|
||||
"bcryptjs": "~0.7.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"blanket": "~1.1.5",
|
||||
|
|
Loading…
Reference in New Issue