Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Scoped PAT: improve error handling when showing a token details (#49997)

Gildas Garcia50a6ebbe6dec
diff --git a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx
index 7ac97feadf3..5a0b45bbdc1 100644
--- a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx
+++ b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/ViewTokenSheet.tsx
@@ -22,6 +22,7 @@ import {
type CapabilityLevelFilter,
} from './TokenCapabilities/TokenCapabilities.utils'
import { TokenDocsButtons } from './TokenDocsButtons'
+import { AlertError } from '@/components/ui/AlertError'
import { useOrganizationsQuery } from '@/data/organizations/organizations-query'
import { useProjectsInfiniteQuery } from '@/data/projects/projects-infinite-query'
import {
@@ -144,8 +145,8 @@ export function ViewTokenSheet({ visible, tokenId, onClose }: ViewTokenSheetProp
'flex flex-col md:flex-row justify-between gap-4 items-start md:items-center border-b'
)}
>
- <p className="truncate" title={`View access for ${token?.name}`}>
- View access for {token?.name}
+ <p className="truncate" title={`View access for ${token?.name ?? 'Unknown'}`}>
+ View access for {token?.name ?? 'Unknown'}
</p>
<TokenDocsButtons />
</SheetHeader>
@@ -161,11 +162,7 @@ export function ViewTokenSheet({ visible, tokenId, onClose }: ViewTokenSheetProp
)}
{tokenError && (
- <div className="flex items-center justify-center py-8">
- <p className="text-destructive">
- Error loading token information. Please try again.
- </p>
- </div>
+ <AlertError error={tokenError} subject="Error loading token information." />
)}
{token && (