UNPKG

@better-auth-ui/core

Version:

Authentication components and data utilities for [Better Auth](https://better-auth.com), available for React and Solid.

23 lines (22 loc) 1.37 kB
import { Localization } from './localization'; export type AuthResultFlow = "accountLinking" | "emailVerification" | "oauth" | "passwordReset" | "unknown"; export type AuthResultReason = "accountLinkConflict" | "accountLinked" | "callbackFailed" | "cancelled" | "emailNotVerified" | "emailVerified" | "expiredLink" | "genericError" | "genericSuccess" | "missingEmail" | "passwordReset" | "signupComplete" | "signupDisabled"; export type AuthResultAction = "accountSettings" | "continue" | "forgotPassword" | "signIn" | "signUp" | "verifyEmail"; export type AuthResult = { action: AuthResultAction; code?: string; flow: AuthResultFlow; intent: "danger" | "success" | "warning"; reason: AuthResultReason; redirectTo?: string; }; export type AuthResultMessage = { description: string; title: string; }; /** Only allow a local redirect path from callback query parameters. */ export declare function getSafeAuthRedirect(value: string | null): string | undefined; /** Classify Better Auth callback parameters into a stable UI result. */ export declare function parseAuthResult(search: string | URLSearchParams, fallbackIntent?: "danger" | "success"): AuthResult; /** Resolve localized copy for a classified callback result. */ export declare function getAuthResultMessage(result: AuthResult, localization: Localization): AuthResultMessage;