export interface LoginPageOptions { title: string; subtitle?: string; emailHint?: string; formAction: string; hiddenFields: Record; /** * Accounts to offer beneath the email field, collapsed behind a disclosure. Every user the * emulator holds, not only the seeded ones: a user created through the API mid-session appears * here too, which is what makes the list useful for testing a sign-up. * * Collapsed by default, so the page an unknown address or a sign-up arrives at is the page it * has always been. Flat rather than grouped by organization, because the emulator asks which * organization in its own later step and grouping here would imply a choice this page does not * make. Each account is a submit button in a second form, so picking one is a single click and * `
` does the expanding, which leaves the page with no JavaScript. The list scrolls * rather than growing the card, so a large store stays usable. Omitted or empty renders the * page exactly as before. */ users?: LoginPageUser[]; } /** A seeded account offered on the sign-in page, so a developer picks rather than remembers. */ export interface LoginPageUser { email: string; name?: string | null; } /** One organization a user may finish signing in to. */ export interface SelectableOrganization { id: string; name: string; } export interface OrganizationSelectPageOptions { /** Who is signing in, so it is obvious whose organizations these are. */ email: string; organizations: SelectableOrganization[]; formAction: string; hiddenFields: Record; } export interface DeviceVerifyPageOptions { title: string; message: string; } export declare function renderDeviceVerifyPage(options: DeviceVerifyPageOptions): string; /** * The page `/oauth2/error` serves. `application_not_found` gets a fixed explanation unless a * description is supplied; any other error shows its code and description. Both values arrive on * the query string, so they are attacker-controlled text: the card renderer escapes them. */ export declare function renderOAuthErrorPage(options: { error: string; description?: string; }): string; export declare function renderLoginPage(options: LoginPageOptions): string; /** * The screen hosted AuthKit shows when a user belongs to more than one organization: a row per * organization, picked before anything is minted. * * Rendered during authorize rather than at the token exchange, because that is where production * asks. The code then carries the organization and the client's exchange succeeds. Without this * step the emulator answers the exchange with `organization_selection_required`, which is an * API-level response a browser client has no way to act on: it surfaces mid-callback as a failed * exchange, and the user is simply stuck. * * Each row is a submit button carrying its own organization id, so picking is one click and the * page still needs no JavaScript. */ export declare function renderOrganizationSelectPage(options: OrganizationSelectPageOptions): string; export interface PasswordPageOptions { /** Who is signing in, shown read-only so the page reads as the second step of one sign-in. */ email: string; formAction: string; /** Carried through with `email` included, so the POST checks the password against the account the previous page resolved. */ hiddenFields: Record; /** Where "Use a different account" leads: the email page, with the same authorize parameters. */ backHref: string; /** Shown above the field after a failed attempt. */ error?: string; } /** * The screen hosted AuthKit shows a user who has a password: after the email, before any * organization question. Served only when the interactive password option is on, because the * one-step email page is what existing browser suites were written against. * * A failed attempt re-renders this page with the error inline rather than redirecting to the * callback with an error parameter, the way an unknown email does. A mistyped password is * something the user retries on the spot; the application only hears about the login once it * has succeeded. No JavaScript, like the other pages, so a plain form POST is the whole protocol. */ export declare function renderPasswordPage(options: PasswordPageOptions): string; export interface ConnectPageOptions { /** The provider slug being connected, e.g. `google-calendar`. */ slug: string; /** Who is authorizing, shown read-only. */ email: string; /** The organization the account is connected for; omitted for a personal connection. */ organizationName?: string; formAction: string; } /** * The page an authorize URL serves under `--interactive`, standing in for the provider's * consent screen. Submitting it connects the account; production would do that once the * provider redirected back, which the emulator cannot reach. */ export declare function renderConnectPage(options: ConnectPageOptions): string; export interface CodePageOptions { title: string; /** The sentence that introduces the address, e.g. "Enter the code we sent to". */ lead: string; /** Who is signing in, shown read-only as on the password page. */ email: string; formAction: string; /** Carried through with `email` and the login token, so the POST resumes the same login. */ hiddenFields: Record; /** Where "Use a different account" leads: the email page, with the same authorize parameters. */ backHref: string; /** Shown above the field after a failed attempt. */ error?: string; } /** * The one-time-code screen hosted AuthKit shows between a correct password and a session while * the account still has something to prove: the emailed code for an unverified mailbox, or the * authenticator code for an enrolled second factor. Served by the interactive password option * only, because those are the gates the `password` grant enforces and this page is how the * browser flow enforces the same ones. A failed attempt re-renders inline, as the password page * does and for the same reason. */ export declare function renderCodePage(options: CodePageOptions): string;