diff --git a/social/email/61-email.js b/social/email/61-email.js index 678de660..b01da58d 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -201,6 +201,10 @@ module.exports = function(RED) { this.disposition = n.disposition || "None"; // "None", "Delete", "Read" this.criteria = n.criteria || "UNSEEN"; // "ALL", "ANSWERED", "FLAGGED", "SEEN", "UNANSWERED", "UNFLAGGED", "UNSEEN" this.authtype = n.authtype || "BASIC"; + if (this.authtype !== "BASIC") { + this.inputs = 1; + this.repeat = 0; + } var flag = false; diff --git a/test/social/email/61-email_spec.js b/test/social/email/61-email_spec.js index dd2316d9..ab6f9845 100644 --- a/test/social/email/61-email_spec.js +++ b/test/social/email/61-email_spec.js @@ -31,6 +31,25 @@ describe('email Node', function () { n1.should.have.property("repeat", 300000); n1.should.have.property("inserver", "imap.gmail.com"); n1.should.have.property("inport", "993"); + n1.should.have.property("authtype", "BASIC"); + done(); + }); + }); + + it('should force input on XOAuth2', function (done) { + var flow = [{ + id: "n1", + type: "e-mail in", + name: "emailin", + authtype: "XOAUTH2", + wires: [ + [] + ] + }]; + helper.load(emailNode, flow, function () { + var n1 = helper.getNode("n1"); + n1.should.have.property("repeat", 0); + n1.should.have.property("inputs", 1); done(); }); });