Permalink
Browse files

Merge branch 'master' of github.com:SportZing/node-pass-reset

  • Loading branch information...
2 parents 1626972 + 60a508d commit d419ed0fb65a031483b8c7c1f1479e87757a7fba @kbjr kbjr committed Nov 12, 2012
Showing with 6 additions and 5 deletions.
  1. +4 −4 lib/index.js
  2. +1 −1 package.json
  3. +1 −0 readme.md
View
8 lib/index.js
@@ -105,14 +105,14 @@ exports.requestResetToken = function(opts) {
if (! login) {
return sendJson.error('No login given', 400);
}
- lookupUsers(login, function(err, users) {
+ lookupUsers(login, function(err, theUsers) {
if (err) {
return sendJson.error(err);
}
- if (! users) {
+ if (! theUsers) {
return sendJson.error('No such user', 404);
}
- async.map(users.users,
+ async.map(theUsers.users,
function(user, callback) {
storage.create(user.id, function(err, token) {
if (err) {
@@ -129,7 +129,7 @@ exports.requestResetToken = function(opts) {
if (err) {
return sendJson.error(err);
}
- sendEmail(users.email, users.users, function(err, sent) {
+ sendEmail(theUsers.email, users, function(err, sent) {
if (err) {
return sendJson.error(err);
}
View
2 package.json
@@ -2,7 +2,7 @@
"author": "James Brumond <james@sportzing.com> (http://jbrumond.me)",
"name": "pass-reset",
"description": "A drop-in password reseting module",
- "version": "0.1.0-1",
+ "version": "0.1.0-3",
"main": "lib/index.js",
"dependencies": {
"uuid-v4": "latest",
View
1 readme.md
@@ -29,6 +29,7 @@ passReset.lookupUsers(function(login, callback) {
User.find({ username: login }, function(err, users) {
if (err) {return callback(err);}
if (! users.length) {return callback(null, false);}
+ var user = users[0];
callback(null, {
email: user.email,
users: [{

0 comments on commit d419ed0

Please sign in to comment.