diff --git a/packages/core/src/db/client.ts b/packages/core/src/db/client.ts index 33ebeac3..9e120f5f 100644 --- a/packages/core/src/db/client.ts +++ b/packages/core/src/db/client.ts @@ -105,7 +105,9 @@ async function initClient(): Promise { // Postgres — dynamically import to avoid bundling in non-Postgres runtimes if (dialect === "postgres") { const { default: postgres } = await import("postgres"); - _pgPool = postgres(url); + _pgPool = postgres(url, { + onnotice: () => {}, // Suppress CREATE TABLE IF NOT EXISTS notices + }); const pool = _pgPool; _exec = { diff --git a/templates/mail/server/handlers/emails.ts b/templates/mail/server/handlers/emails.ts index f32a83f0..3e4e12f1 100644 --- a/templates/mail/server/handlers/emails.ts +++ b/templates/mail/server/handlers/emails.ts @@ -97,9 +97,11 @@ async function getAccessToken(accountEmail: string): Promise { async function getAccountTokens( forEmail?: string, ): Promise> { - const accounts = forEmail - ? await listOAuthAccountsByOwner("google", forEmail) - : await listOAuthAccounts("google"); + // In dev mode (local@localhost), show all accounts regardless of owner + const accounts = + forEmail && forEmail !== "local@localhost" + ? await listOAuthAccountsByOwner("google", forEmail) + : await listOAuthAccounts("google"); const results: Array<{ email: string; accessToken: string }> = []; diff --git a/templates/mail/server/lib/google-auth.ts b/templates/mail/server/lib/google-auth.ts index ab26844f..888dda14 100644 --- a/templates/mail/server/lib/google-auth.ts +++ b/templates/mail/server/lib/google-auth.ts @@ -235,7 +235,8 @@ export async function getClients( * checks only that specific account. */ export async function isConnected(forEmail?: string): Promise { - if (forEmail) { + // In dev mode, check all accounts regardless of owner + if (forEmail && forEmail !== "local@localhost") { const accounts = await listOAuthAccountsByOwner("google", forEmail); return accounts.length > 0; } @@ -263,7 +264,8 @@ export async function getAuthStatus( accountId: string; tokens: Record; }>; - if (forEmail) { + // In dev mode (local@localhost), show all accounts regardless of owner + if (forEmail && forEmail !== "local@localhost") { oauthAccounts = await listOAuthAccountsByOwner("google", forEmail); } else { oauthAccounts = await listOAuthAccounts("google");