{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "oauth-consent-react", "title": "OAuth Consent for React", "description": "OAuth 2.1 consent component for an existing authenticated application.", "dependencies": [ "@supabase/supabase-js@latest" ], "registryDependencies": [ "button", "card", "https://supabase.com/library/r/safe-next-path.json" ], "files": [ { "path": "registry/default/blocks/oauth-consent/components/oauth-consent.tsx", "content": "'use client'\n\nimport { cn } from '@/lib/utils'\nimport {\n useOAuthConsent,\n type OAuthConsentDecision,\n} from '@/registry/default/blocks/oauth-consent/hooks/use-oauth-consent'\nimport { Button } from '@/registry/default/components/ui/button'\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '@/registry/default/components/ui/card'\n\nconst getInitial = (value: string) => value.trim().charAt(0).toUpperCase() || '?'\n\ninterface ConsentCardShellProps extends React.ComponentPropsWithoutRef<'div'> {\n clientName: string\n productName: string\n}\n\nfunction ConsentCardShell({\n clientName,\n productName,\n className,\n children,\n ...props\n}: ConsentCardShellProps) {\n return (\n
\n Allow access only if you recognize this application. It can act on your behalf only within\n the requested permissions and the access you already have.\n
\n {error && (\n\n {error}\n
\n )}\n\n Loading authorization request...\n
\n ) : (\n\n {error ??\n 'Unable to load the authorization request. Start again from your OAuth client.'}\n
\n )}\n