Skip to content

Self-improving AI Employees for everyone

feat(credentials): surface OAuth account email/name in the modal

trohitg3626fd3111b4
diff --git a/client/src/components/credentials/catalogueAdapter.ts b/client/src/components/credentials/catalogueAdapter.ts
index 6c1f74c5..5f16a505 100644
--- a/client/src/components/credentials/catalogueAdapter.ts
+++ b/client/src/components/credentials/catalogueAdapter.ts
@@ -172,6 +172,7 @@ export function rehydrateProvider(entry: ServerProviderConfig): ProviderConfig {
hasRateLimits: entry.has_rate_limits,
usageService: entry.usage_service,
stored: entry.stored,
+ account_label: entry.account_label ?? null,
};
}
diff --git a/client/src/components/credentials/primitives/OAuthConnect.tsx b/client/src/components/credentials/primitives/OAuthConnect.tsx
index d2cbaf85..31650fea 100644
--- a/client/src/components/credentials/primitives/OAuthConnect.tsx
+++ b/client/src/components/credentials/primitives/OAuthConnect.tsx
@@ -93,7 +93,9 @@ const OAuthConnect: React.FC<Props> = ({
<div className="rounded-md border border-accent/30 bg-accent/10 p-3">
<div className="text-sm leading-relaxed text-muted-foreground">
{connected
- ? `Your ${config.name} account is connected.`
+ ? config.account_label
+ ? `Connected as ${config.account_label}.`
+ : `Your ${config.name} account is connected.`
: (stored || !hasFields)
? 'Click Login to authorize.'
: 'Enter your credentials above to get started.'}
diff --git a/client/src/components/credentials/types.ts b/client/src/components/credentials/types.ts
index 7cafe1dc..a4952f7e 100644
--- a/client/src/components/credentials/types.ts
+++ b/client/src/components/credentials/types.ts
@@ -119,6 +119,8 @@ export interface ProviderConfig {
usageService?: string;
/** Server-resolved: whether a key/token exists in the credentials DB. */
stored?: boolean;
+ /** Connected account identifier (email or display name) for OAuth providers. */
+ account_label?: string | null;
}
// ============================================================================
diff --git a/client/src/hooks/useCatalogueQuery.ts b/client/src/hooks/useCatalogueQuery.ts
index 3b092656..3a9e19e9 100644
--- a/client/src/hooks/useCatalogueQuery.ts
+++ b/client/src/hooks/useCatalogueQuery.ts
@@ -104,6 +104,8 @@ export interface ServerProviderConfig {
usage_service?: string;
/** Server-resolved: whether a key/token is stored in the credentials DB. */
stored?: boolean;
+ /** Connected account identifier (email or display name) for OAuth providers. */
+ account_label?: string | null;
}
export interface CatalogueResponse {
diff --git a/server/routers/websocket.py b/server/routers/websocket.py
index 08e90d06..55b34f61 100644
--- a/server/routers/websocket.py
+++ b/server/routers/websocket.py
@@ -361,6 +361,7 @@ async def handle_get_credential_catalogue(data: Dict[str, Any], websocket: WebSo
kind = provider.get("kind", "")
status_hook = provider.get("status_hook")
+ tokens = None
if status_hook:
# Status-hook providers (whatsapp, android, twitter, google, telegram)
# use OAuth tokens or special connection state.
@@ -376,6 +377,15 @@ async def handle_get_credential_catalogue(data: Dict[str, Any], websocket: WebSo
else:
provider["stored"] = False
+ # Surface the connected account identifier (email > display name)
+ # so the modal can render "Connected as [email protected]" without a
+ # per-provider status hook. Twitter / Google / Stripe / Claude
+ # all populate `email` / `name` via `auth_service.store_oauth_tokens`.
+ if tokens:
+ provider["account_label"] = tokens.get("email") or tokens.get("name")
+ else:
+ provider["account_label"] = None
+
return catalogue