mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
Refactor authorize page to move Next.js dependencies into the page shell and have Next.js-agnostic code for the core logic. Add unit tests for authorize screen. ## Summary by CodeRabbit * **New Features** * New end-to-end API authorization UI: loading, error, invalid, approved, and main approval screens. * Organization selector with preselection, create-organization link, MCP warning, expiration handling, and approve/decline actions. * Improved page title handling via layout/head provider. * **Tests** * Added comprehensive component tests covering loading, error, approval flows, organization states, validation, and side effects.
28 lines
703 B
TypeScript
28 lines
703 B
TypeScript
import { ApiAuthorizationInvalidScreen } from './ApiAuthorization.Invalid'
|
|
import { ApiAuthorizationValidScreen } from './ApiAuthorization.Valid'
|
|
|
|
export interface ApiAuthorizationScreenProps {
|
|
auth_id: string | undefined
|
|
organization_slug: string | undefined
|
|
navigate: (destination: string) => void
|
|
}
|
|
|
|
export function ApiAuthorizationScreen({
|
|
auth_id,
|
|
organization_slug,
|
|
navigate,
|
|
}: ApiAuthorizationScreenProps) {
|
|
const valid = !!auth_id
|
|
if (!valid) {
|
|
return <ApiAuthorizationInvalidScreen missingParameters={['auth_id']} />
|
|
}
|
|
|
|
return (
|
|
<ApiAuthorizationValidScreen
|
|
auth_id={auth_id}
|
|
organization_slug={organization_slug}
|
|
navigate={navigate}
|
|
/>
|
|
)
|
|
}
|