mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-01 19:18:35 -04:00
fix(reminders): support OAuth SMTP accounts (#5649)
This commit is contained in:
@@ -2412,11 +2412,16 @@ async function initReminderSettings() {
|
||||
// what the Integrations panel manages. Treat the email channel as
|
||||
// configured if there's at least one account with SMTP set.
|
||||
let emailAccounts = [];
|
||||
const smtpAccountReady = (account) => !!(
|
||||
account.smtp_host
|
||||
&& account.smtp_user
|
||||
&& (account.has_smtp_password || account.oauth_provider === 'google')
|
||||
);
|
||||
try {
|
||||
const res = await fetch('/api/email/accounts', { credentials: 'same-origin' });
|
||||
if (res.ok) {
|
||||
const d = await res.json();
|
||||
emailAccounts = (d.accounts || []).filter(a => a.smtp_host && a.smtp_user && a.has_smtp_password);
|
||||
emailAccounts = (d.accounts || []).filter(smtpAccountReady);
|
||||
}
|
||||
} catch (_) {}
|
||||
let smtpConfigured = emailAccounts.length > 0;
|
||||
@@ -2520,7 +2525,7 @@ async function initReminderSettings() {
|
||||
const res = await fetch('/api/email/accounts', { credentials: 'same-origin' });
|
||||
if (res.ok) {
|
||||
const d = await res.json();
|
||||
emailAccounts = (d.accounts || []).filter(a => a.smtp_host && a.smtp_user && a.has_smtp_password);
|
||||
emailAccounts = (d.accounts || []).filter(smtpAccountReady);
|
||||
}
|
||||
} catch (_) {}
|
||||
smtpConfigured = emailAccounts.length > 0;
|
||||
|
||||
Reference in New Issue
Block a user