import { type DrizzleExecutor } from "../drizzle.js"; import type { FastifyRequest } from "fastify"; import type { ServerConfig } from "../config/type.js"; import type { ActiveSession } from "./types.js"; import type { User } from "../user/types.js"; import { type AuthenticationRequest } from "./metadata.js"; import { type CloudflareAccessIdentity } from "./cloudflare-access.js"; import { TokenService } from "./tokens.js"; import { type CreatedDevToken } from "./developmentTokenCreate.js"; export interface AuthenticatedAccount { accountId: string; session?: ActiveSession; cloudflareAccess?: CloudflareAccessIdentity; } export type Authenticated = { local: true; user: User; } | (AuthenticatedAccount & { local: false; user: User; }); export interface AuthToken { token: string; expiresAt: string; profileRequired: boolean; } export declare class AuthService { private readonly config; private readonly executor; private readonly tokens; private readonly localToken; private readonly passwordPepper; private readonly shouldTouchAccess; constructor(config: ServerConfig, executor: DrizzleExecutor, tokens: TokenService, suppliedLocalToken?: string); /** Account authentication is reserved for account-management paths such as creating a profile. */ authenticateAccount(request: AuthenticationRequest): Promise; /** Product routes use active Users, never bare authentication accounts. */ authenticate(request: AuthenticationRequest): Promise; registerPassword(body: unknown, request: FastifyRequest): Promise; loginPassword(body: unknown, request: FastifyRequest): Promise; resetPassword(targetUserId: string, body: unknown, request: FastifyRequest): Promise<{ revokedSessionCount: number; } | "invalid" | "unauthorized">; createProfile(body: unknown, request: FastifyRequest): Promise; updateProfile(body: unknown, request: FastifyRequest): Promise; requestMagicLink(body: unknown): Promise; verifyMagicLink(body: unknown, request: FastifyRequest): Promise; startOidc(providerName: string): Promise; completeOidc(providerName: string, query: { code?: string; state?: string; error?: string; }, request: FastifyRequest): Promise; refresh(request: FastifyRequest): Promise; createDevToken(request: FastifyRequest): Promise; logout(request: FastifyRequest): Promise; private issue; } //# sourceMappingURL=service.d.ts.map