Files
9b3435010c fix(studio): show client ID and app ID on OAuth apps page (#54324)
## Problem

On the OAuth apps page in Studio, the table showed only the Client ID,
and the edit panel showed the app ID as unlabeled `ID: ...` text under
the app name. It was hard to tell the two IDs apart, or to copy the
right one. That contributed to the wrong ID type being handed to the
team that manages the Stripe pipeline allowlist (incident, Nov 20–23).

## Solution

- **Table:** add an **App ID** column next to **Client ID**. Both are
shown shortened (`65****9a71`) with a copy button. Hover an ID to show
the whole value. The copy button always copies the whole value.
- **Edit panel:** show **Client ID** and **App ID** as separate labeled,
copiable fields (full value, not shortened), each with one line of
helper text:
- Client ID: "Used to identify your app when it makes OAuth requests to
Supabase."
- App ID: "Used to manage your app on Supabase, such as updating or
deleting it."
- Remove the old `ID: ...` description under the app name.
- Add one small shared component, `OAuthAppId`, used by the table and
the edit panel.

The helper text follows the discussion in Slack: `client_id` is what the
deployed app sends in OAuth requests to the Management API, and `app_id`
is the primary key the app's author uses in platform APIs (for example
to update or delete the app).

Not in this PR: the Authorized apps table already shows its App ID with
a copy button, so it is unchanged. No API or data changes.

## Please check

- **Helper text wording.** Is it accurate for both IDs?
- **Shortened IDs.** The first 2 and last 4 characters, with `****`
between, only for IDs longer than 20 characters.

## Review instructions

1. Open **Organization → OAuth Apps** (`/org/<slug>/apps`) and create an
app if there is none.
2. In **Publishable apps**, check that **Client ID** and **App ID** both
show as shortened values, and that each copy button copies the full
value.
3. Hover a shortened ID. It should show a tooltip with the full value.
4. Open the app's edit panel. Check that Client ID and App ID are
labeled, show the full value, and copy correctly, and that the old `ID:
...` text under the app name is gone.

Checked locally against the full platform stack (format, lint,
type-check, and by eye). No tests added: the change is layout and
display only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: John Stokvis <345546350+stokvis-at-supabase@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: kemal <hello@kemal.earth>
2026-11-30 15:55:56 -06:00

45 lines
1.5 KiB
TypeScript

import { CheckIcon, CopyIcon } from 'lucide-react'
import { useState } from 'react'
import { copyToClipboard, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
export const IdCopyChip = ({ id, label }: { id: string; label: string }) => {
const [isCopied, setIsCopied] = useState(false)
const handleCopy = (e: React.SyntheticEvent) => {
e.stopPropagation()
copyToClipboard(id)
setIsCopied(true)
setTimeout(() => setIsCopied(false), 2000)
}
return (
<Tooltip>
<TooltipTrigger asChild>
<button
tabIndex={0}
onClick={handleCopy}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault()
handleCopy(e)
}
}}
className="inline-flex items-center gap-x-1 cursor-pointer border border-transparent border-dashed rounded-sm transition-colors hover:bg-surface-100 hover:border hover:border-strong group font-mono text-xs text-foreground-lighter hover:text-foreground-light px-1 -ml-1 whitespace-nowrap"
>
{id}
{isCopied ? (
<CheckIcon size={12} strokeWidth={1.25} className="text-primary" />
) : (
<CopyIcon
size={12}
strokeWidth={1.25}
className="opacity-0 group-hover:opacity-100 transition-opacity"
/>
)}
</button>
</TooltipTrigger>
<TooltipContent>{label}</TooltipContent>
</Tooltip>
)
}