added some comments

This commit is contained in:
Wyatt Johnson
2018-01-03 14:34:50 -07:00
parent 375fbd3790
commit 0850b1f982
+10 -1
View File
@@ -628,7 +628,9 @@ module.exports = class UsersService {
}
/**
* Verifies a jwt and returns the associated user.
* Verifies a jwt and returns the associated user. Throws an error when the
* token isn't valid.
*
* @param {String} token the JSON Web Token to verify
*/
static async verifyPasswordResetToken(token) {
@@ -648,6 +650,7 @@ module.exports = class UsersService {
/**
* Finds a user using a value which gets compared using a prefix match against
* the user's email address and/or their username.
*
* @param {String} value value to search by
* @return {Promise}
*/
@@ -767,6 +770,12 @@ module.exports = class UsersService {
}, tokenOptions);
}
/**
* verifyEmailConfirmationToken checks the validity of a given token without
* actually confirming the user's email address.
*
* @param {String} token the token to verify
*/
static async verifyEmailConfirmationToken(token) {
const decoded = await UsersService.verifyToken(token, {
subject: EMAIL_CONFIRM_JWT_SUBJECT