From a9f30339072ba8d7636c5e2eeb419bb37f247ff3 Mon Sep 17 00:00:00 2001 From: Halla Moore Date: Thu, 16 Feb 2017 18:45:03 -0800 Subject: [PATCH] [cloud-workers, isomorphic-core] Implement the SendRemindersWorker Summary: Process reminders metadata and send the reminder email if there haven't been any replies. Checking for replies involves checking each of the folders in `folderImapNames` for messages that are in reply to the messages in `messageIdHeaders`. Test Plan: manual Reviewers: khamidou, juan, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3958 --- packages/isomorphic-core/src/models/account.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/isomorphic-core/src/models/account.js b/packages/isomorphic-core/src/models/account.js index 93cab6168..c992fbad0 100644 --- a/packages/isomorphic-core/src/models/account.js +++ b/packages/isomorphic-core/src/models/account.js @@ -130,6 +130,9 @@ module.exports = (sequelize, Sequelize) => { } if (this.provider === 'gmail') { const {xoauth2} = this.decryptedCredentials(); + if (!xoauth2) { + throw new Error("Missing XOAuth2 Token") + } const {imap_username} = this.connectionSettings; const token = this.bearerToken(xoauth2); config.auth = { user: imap_username, xoauth2: token }