From 746a416b7f1522bc0383cc7cfcafab83a988eac6 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Thu, 31 May 2018 01:36:43 +0530 Subject: [PATCH] fix: remove email update compulsion --- common/models/user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/models/user.js b/common/models/user.js index 69472224ff..fb53ab216e 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -518,11 +518,11 @@ module.exports = function(User) { )({ ttl }); }; - User.prototype.getEncodedEmail = function getEncodedEmail() { - if (!this.email) { + User.prototype.getEncodedEmail = function getEncodedEmail(email) { + if (!email) { return null; } - return Buffer(this.email).toString('base64'); + return Buffer(email).toString('base64'); }; User.decodeEmail = email => Buffer(email, 'base64').toString();