Created
November 28, 2012 20:45
-
-
Save deedubs/4164315 to your computer and use it in GitHub Desktop.
Revisions
-
deedubs revised this gist
Nov 28, 2012 . 2 changed files with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,12 @@ User.newPassword = function(user, currentUser, done) { pass.hash(password, function(err, salt, hash) { currentUser.__password = { salt: salt, hash: hash } currentUser.updatedAt = new Date(); User .save(currentUser, done); }); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ router.post('/newPassword', function (req, res) { User.newPassword(req.currentUser, req.body.password, function (err) { res.send(200); }; }); -
nicki9knuckles created this gist
Nov 28, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ User.newPassword = function(user, currentUser) { pass.hash(password, function(err, salt, hash) { currentUser.__password = { salt: salt, hash: hash } currentUser.updatedAt = new Date(); User .save(currentUser, function(err) { req.session._userId = currentUser._id; res.json(currentUser); }); }); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ router.post('/newPassword', function (req, res) { User.newPassword(req.currentUser, req.body.password); });