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