@bobfrankston/mailx-imap 0.1.61 → 0.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +14 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -744,6 +744,20 @@ export class ImapManager extends EventEmitter {
|
|
|
744
744
|
tokenDirectory: tokenDir,
|
|
745
745
|
credentialsKey: "installed",
|
|
746
746
|
loginHint: account.imap.user,
|
|
747
|
+
// Route info/error to the daemon log. oauthsupport's
|
|
748
|
+
// default logFn drops info silently — that masked "full
|
|
749
|
+
// reauth keeps firing" with no log trail (Bob 2026-05-25
|
|
750
|
+
// "the log should be showing the auth request"). With
|
|
751
|
+
// this, "Forcing consent prompt", "No valid token found,
|
|
752
|
+
// starting OAuth authentication", "Token refresh failed"
|
|
753
|
+
// all land in rmfmail-*.log under [oauth] prefix.
|
|
754
|
+
logFn: (type, message) => {
|
|
755
|
+
const prefix = ` [oauth ${account.id}]`;
|
|
756
|
+
if (type === "error")
|
|
757
|
+
console.error(`${prefix} ${message}`);
|
|
758
|
+
else
|
|
759
|
+
console.log(`${prefix} ${message}`);
|
|
760
|
+
},
|
|
747
761
|
});
|
|
748
762
|
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error(`OAuth token fetch timeout (${TOKEN_FETCH_TIMEOUT_MS / 1000}s)`)), TOKEN_FETCH_TIMEOUT_MS));
|
|
749
763
|
const result = await Promise.race([authPromise, timeoutPromise]);
|