don't use this keyword in UserService methods

This commit is contained in:
Riley Davis
2016-11-17 11:31:27 -07:00
parent 869d871157
commit 145bb68681
+2 -2
View File
@@ -439,7 +439,7 @@ UserService.createPasswordResetToken = function (email) {
* verifies a jwt and returns the associated user
* @param {String} token the JSON Web Token to verify
*/
UserService.verifyPasswordResetToken = function (token) {
UserService.verifyPasswordResetToken = token => {
return new Promise((resolve, reject) => {
jwt.verify(token, process.env.TALK_SESSION_SECRET, (error, decoded) => {
if (error) {
@@ -455,7 +455,7 @@ UserService.verifyPasswordResetToken = function (token) {
* and make an entry if it does not exist.
* reject if entry already exists.
*/
return this.findById(decoded.userId);
return UserService.findById(decoded.userId);
});
};