[object Object]

← back to George Gmail

Make /api/profile honor ?account= param like the other 31 routes

02ef28b21f128daa179b19247acef1e1d60dc4e6 · 2026-05-18 14:34:30 -0700 · Steve Abrams

Files touched

Diff

commit 02ef28b21f128daa179b19247acef1e1d60dc4e6
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon May 18 14:34:30 2026 -0700

    Make /api/profile honor ?account= param like the other 31 routes
---
 server.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server.js b/server.js
index aed41dd..f78e370 100644
--- a/server.js
+++ b/server.js
@@ -770,7 +770,9 @@ app.get('/api/status', (req, res) => {
 // ─── API: Get Profile (email address, history) ───
 app.get('/api/profile', async (req, res) => {
   try {
-    const profile = await gmail.users.getProfile({ userId: 'me' });
+    const { gmail: gm, key: account } = resolveAccount(req);
+    if (!gm) return res.status(400).json({ error: `Account "${account}" not configured` });
+    const profile = await gm.users.getProfile({ userId: 'me' });
     res.json(profile.data);
   } catch (e) {
     res.status(500).json({ error: e.message });

← 2cbc311 remove bogus stevesclaude account from George — theagentabra  ·  back to George Gmail  ·  Add fleet auto-responder for the 44 dw-domain-fleet domains d135118 →