Function: OAuthConsent()
OAuthConsent(
__namedParameters):Element
Defined in: OAuthConsent/OAuthConsent.tsx:330
Accessible, framework-agnostic OAuth consent screen component.
Renders a standards-compliant "authorize this client" page with support for
flat and GitHub-style grouped/hierarchical scopes. Granting a parent scope
automatically locks all descendant scopes (checked + disabled). All visible
copy is injected via labels; no strings are hardcoded inside this component.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | OAuthConsentProps |
Returns
Element
Example
<OAuthConsent
clientName="My App"
scopes={[
{ key: 'read', label: 'Read', description: 'Read access', required: true },
{ key: 'write', label: 'Write', description: 'Write access' },
]}
onAuthorize={async (scopes) => {
const res = await authorize({ variables: { scopes } });
return { ok: !!res.ok };
}}
onAuthorized={() => { window.location.href = resumeUrl; }}
onDeny={() => navigate('/')}
labels={labels}
/>