Skip to content

Commit

Permalink
Merge pull request #43 from mirceaalexandru/buffer
Browse files Browse the repository at this point in the history
Added test for password as buffer. Update some dependencies.
  • Loading branch information
mirceaalexandru committed May 24, 2016
2 parents afb684f + dce07dd commit e8e4e09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"dependencies": {
"eraro": "0.4.1",
"lodash": "3.10.1",
"lodash": "4.13.x",
"node-uuid": "1.4.7"
},
"devDependencies": {
Expand Down
6 changes: 6 additions & 0 deletions user.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ module.exports = function user (options) {
}
else return done(null, {ok: false, why: 'user-not-found', nick: q.nick, email: q.email})
}

if (_.isBuffer(user.pass)) {
user.pass = user.pass.toString('utf8')
}

args.user = user

return cmd.call(seneca, args, done)
Expand Down Expand Up @@ -623,6 +628,7 @@ module.exports = function user (options) {
return make_login(user, 'auto')
}
else {

seneca.act({role: role, cmd: 'verify_password', proposed: args.password, pass: user.pass, salt: user.salt}, function (err, out) {
if (err) return done(err)
if (!out.ok) {
Expand Down

0 comments on commit e8e4e09

Please sign in to comment.