passport-local-sequelize
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -14,2 +14,3 @@ var util = require('util'), | ||
keylen: 512, | ||
digest: 'sha1', | ||
usernameField: 'username', | ||
@@ -30,3 +31,4 @@ usernameLowerCase: false, | ||
userExistsError: 'User already exists with %s', | ||
activationError: 'Email activation required' | ||
activationError: 'Email activation required', | ||
noSaltValueStoredError: 'Authentication not possible. No salt value stored in db!' | ||
}; | ||
@@ -47,3 +49,3 @@ | ||
hash: { | ||
type: Sequelize.STRING, | ||
type: Sequelize.TEXT, | ||
allowNull: false | ||
@@ -62,2 +64,6 @@ }, | ||
allowNull: true | ||
}, | ||
verified: { | ||
type: Sequelize.BOOLEAN, | ||
allowNull: true | ||
} | ||
@@ -94,3 +100,3 @@ }; | ||
crypto.pbkdf2(password, salt, options.iterations, options.keylen, function (err, hashRaw) { | ||
crypto.pbkdf2(password, salt, options.iterations, options.keylen, options.digest, function (err, hashRaw) { | ||
if (err) { | ||
@@ -130,4 +136,9 @@ return cb(err); | ||
var self = this; | ||
// TODO: Fix callback and behavior to match passport | ||
crypto.pbkdf2(password, this.get(options.saltField), options.iterations, options.keylen, function (err, hashRaw) { | ||
// prevent to throw error from crypto.pbkdf2 | ||
if (!this.get(options.saltField)) { | ||
return cb(null, false, { message: options.noSaltValueStoredError }); | ||
} | ||
crypto.pbkdf2(password, this.get(options.saltField), options.iterations, options.keylen, options.digest, function (err, hashRaw) { | ||
if (err) { | ||
@@ -226,6 +237,6 @@ return cb(err); | ||
UserSchema.activate = function (email, password, activationKey, cb) { | ||
UserSchema.activate = function (username, password, activationKey, cb) { | ||
var self = this; | ||
var auth = self.authenticate(); | ||
auth(email, password, function (err, user, info) { | ||
auth(username, password, function (err, user, info) { | ||
@@ -232,0 +243,0 @@ if (err) { return cb(err); } |
{ | ||
"name": "passport-local-sequelize", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Sequelize plugin that simplifies building username and password login with Passport", | ||
@@ -26,11 +26,11 @@ "main": "lib/passport-local-sequelize.js", | ||
"passport-local": "~1.0.0", | ||
"sequelize": "~3.1.1", | ||
"lodash": "~3.8.0" | ||
"sequelize": "~3.30.1", | ||
"lodash": "~4.17.4" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.18.2", | ||
"jshint": "~2.5.0", | ||
"sqlite3": "~2.2.3", | ||
"should": "~3.3.1" | ||
"mocha": "~3.2.0", | ||
"jshint": "~2.9.4", | ||
"sqlite3": "~3.1.8", | ||
"should": "~11.2.0" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # Passport-Local Sequelize |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
14626
6
285
+ Added@types/geojson@1.0.6(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddottie@1.1.1(transitive)
+ Addedgeneric-pool@2.4.2(transitive)
+ Addedlodash@4.12.04.17.21(transitive)
+ Addedmoment-timezone@0.5.45(transitive)
+ Addedms@2.0.0(transitive)
+ Addedretry-as-promised@2.3.2(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsequelize@3.30.4(transitive)
+ Addedshimmer@1.1.0(transitive)
+ Addedterraformer@1.0.12(transitive)
+ Addedterraformer-wkt-parser@1.2.1(transitive)
+ Addedtoposort-class@1.0.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedvalidator@5.7.0(transitive)
+ Addedwkx@0.2.0(transitive)
- Removedbluebird@2.9.34(transitive)
- Removeddottie@0.3.1(transitive)
- Removedgeneric-pool@2.2.0(transitive)
- Removedlodash@3.8.0(transitive)
- Removedmoment-timezone@0.3.1(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedsequelize@3.1.1(transitive)
- Removedshimmer@1.0.0(transitive)
- Removedtoposort-class@0.3.1(transitive)
- Removedvalidator@3.43.0(transitive)
Updatedlodash@~4.17.4
Updatedsequelize@~3.30.1