Skip to content

Commit 3227d1f

Browse files
committed
Fix incorrect verification token crash
1 parent 2091be4 commit 3227d1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/server/controllers/UserController.js

+4
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ UserController.declineById = function (id, callback){
393393
*/
394394
UserController.verifyByToken = function(token, callback){
395395
User.verifyEmailVerificationToken(token, function(err, email){
396+
if (!email) {
397+
callback("Invalid token", null);
398+
return;
399+
}
396400
User.findOneAndUpdate({
397401
email: email.toLowerCase()
398402
},{

0 commit comments

Comments
 (0)