import type { OAuthConfig } from '#auth-utils'; export interface OAuthMastodonConfig { /** * The instance domain to authenticate against, e.g. `mastodon.social`. * * Unlike most OAuth providers, a Mastodon account lives on a single instance and there is no * shared authorization server, so the instance must be known before the flow can start. If not * set here, it can be provided at runtime as an `instance` query parameter on the initial request * (e.g. `/auth/mastodon?instance=mastodon.social`). A full handle such as `@user@mastodon.social` * or `user@mastodon.social` is also accepted, only the domain part is used. * @default process.env.NUXT_OAUTH_MASTODON_INSTANCE * @example 'mastodon.social' */ instance?: string; /** * The name of the application shown to users on the instance's authorization screen. * * Mastodon has no concept of a pre-registered, shared client id: an application must be * registered against every instance it authenticates users on (`POST /api/v1/apps`). This is * that application's display name. * @default 'Nuxt Auth Utils' */ clientName?: string; /** * Mastodon OAuth Scope. * @default ['read'] * @see https://docs.joinmastodon.org/api/oauth-scopes/ * @example ['read', 'read:accounts'] */ scope?: string[]; /** * Redirect URL to allow overriding for situations like prod failing to determine public hostname * @default process.env.NUXT_OAUTH_MASTODON_REDIRECT_URL or current URL */ redirectURL?: string; } export interface OAuthMastodonUser { id: string; username: string; /** * Always the full `user@instance` handle here, even for the authenticated user's own account. * Mastodon's API normally only qualifies `acct` with `@instance` for remote accounts and returns * the bare username for your own, we normalize it since an account only means something together * with the instance it lives on. */ acct: string; display_name: string; url: string; avatar: string; [key: string]: unknown; } interface MastodonTokens { access_token: string; token_type: string; scope: string; created_at: number; } export declare function defineOAuthMastodonEventHandler({ config: userConfig, onSuccess, onError }: OAuthConfig): import("nuxt/server").EventHandler>; export {};