[mini-feat] Display the IMAP commands we're sending when NYLAS_DEBUG is set.

Makes debugging a bit easier.
This commit is contained in:
Karim Hamidou 2017-01-19 16:59:19 -08:00
parent 76ce0d6e2f
commit 9b40df95b4

View file

@ -88,6 +88,10 @@ class IMAPConnection extends EventEmitter {
authTimeout: this._settings.authTimeout || AUTH_TIMEOUT_MS,
}
if (process.env.NYLAS_DEBUG) {
result.debug = console.log;
}
// This account uses XOAuth2, and we have the client_id + refresh token
if (this._settings.refresh_token) {
const xoauthFields = ['client_id', 'client_secret', 'imap_username', 'refresh_token'];