Permalink
Browse files

v1.3.2 fixed bug on password reset

  • Loading branch information...
1 parent e1966fa commit a3dbb41467dc3527d21ecab1696e51178f6bbe3c Stephen Braitsch committed Mar 11, 2013
Showing with 13 additions and 6 deletions.
  1. +8 −4 app/server/modules/account-manager.js
  2. +1 −1 app/server/router.js
  3. +3 −0 history.md
  4. +1 −1 package.json
@@ -94,10 +94,14 @@ exports.updateAccount = function(newData, callback)
exports.updatePassword = function(email, newPass, callback)
{
accounts.findOne({email:email}, function(e, o){
- saltAndHash(newPass, function(hash){
- o.pass = hash;
- accounts.save(o, {safe: true}, callback);
- });
+ if (e){
+ callback(e, null);
+ } else{
+ saltAndHash(newPass, function(hash){
+ o.pass = hash;
+ accounts.save(o, {safe: true}, callback);
+ });
+ }
});
}
@@ -147,7 +147,7 @@ module.exports = function(app) {
var email = req.session.reset.email;
// destory the session immediately after retrieving the stored email //
req.session.destroy();
- AM.updatePassword(email, nPass, function(o){
+ AM.updatePassword(email, nPass, function(e, o){
if (o){
res.send('ok', 200);
} else{
View
@@ -1,3 +1,6 @@
+####1.3.2 / 2013-03-11
+ * fixed bug on password reset
+
####1.3.1 / 2013-03-07
* adding MIT license
View
@@ -1,6 +1,6 @@
{
"name": "node-login",
- "version": "1.3.1",
+ "version": "1.3.2",
"description": "A template for quickly building login systems on top of Node.js & MongoDb",
"author": {
"name": "Stephen Braitsch",

0 comments on commit a3dbb41

Please sign in to comment.