import { type Settings } from "@opengeni/config"; import { type ManagedAuth, type ManagedEmailMessage, type ManagedEmailTransport } from "@opengeni/core"; import type { Database } from "@opengeni/db"; export type { ManagedAuth }; export declare function managedAuthRequiresEmailVerification(settings: Pick): boolean; export declare function managedAuthUserCreateOverride(settings: Pick, user: { emailVerified: boolean; } & Record): { data: typeof user; } | undefined; export declare function managedAuthUserCreateAdmission(settings: Pick, user: { emailVerified: boolean; } & Record, providerId: string): { data: typeof user; } | false | undefined; /** Keep Better Auth password policy and storage format behind this boundary. */ export declare function hashManagedAuthPassword(password: string): Promise; export declare function createManagedAuth(settings: Settings, db: Database, managedEmailTransport: ManagedEmailTransport): ManagedAuth | null; export type ManagedAuthOAuthAttempt = { transactionId: string; provider: "google" | "github"; authorityHash: string; transactionSecretHash: string; expectedGeneration: string; expectedActorEpoch: string; }; /** * Resolve OpenGeni's server-only login transaction proof from Better Auth's * database-backed OAuth state before the provider callback consumes it. */ export declare function resolveManagedAuthOAuthAttempt(auth: ManagedAuth, request: Request, provider: "google" | "github", publicBaseUrl: string): Promise; export declare function isolatedManagedAuthOAuthCallbackRequest(auth: ManagedAuth, request: Request): Promise<{ request: Request; stateCookieName: string; }>; export declare function managedAuthOAuthReturnMatches(raw: string, expectedOrigin: string, transactionId: string, outcome: "complete" | "error"): boolean; export declare function sendManagedAuthEmail(transport: ManagedEmailTransport, input: Omit): Promise;