fix xoauth/xoauth2

fork
Brian White 11 years ago
parent 68b1db11c3
commit dfe176fdfd

@ -46,7 +46,8 @@ function ImapConnection(options) {
port: options.port || 143,
secure: options.secure || false,
connTimeout: options.connTimeout || 10000, // connection timeout in msecs
debug: false
xoauth: options.xoauth,
xoauth2: options.xoauth2
};
this._state = {
@ -1346,11 +1347,10 @@ ImapConnection.prototype._login = function(cb) {
if (this._serverSupports('LOGINDISABLED'))
return cb(new Error('Logging in is disabled on this server'));
if (this._serverSupports('AUTH=XOAUTH') && 'xoauth' in this._options) {
if (this._serverSupports('AUTH=XOAUTH') && this._options.xoauth) {
this._send('AUTHENTICATE XOAUTH ' + utils.escape(this._options.xoauth),
fnReturn);
} else if (this._serverSupports('AUTH=XOAUTH2')
&& 'xoauth2' in this._options) {
} else if (this._serverSupports('AUTH=XOAUTH2') && this._options.xoauth2) {
this._send('AUTHENTICATE XOAUTH2 ' + utils.escape(this._options.xoauth2),
fnReturn);
} else if (this._options.username !== undefined

Loading…
Cancel
Save