import type { OwoxTokenFacade } from '../../facades/owox-token-facade.js'; import type { DatabaseStore } from '../../store/database-store.js'; /** * Responsible for persisting user authentication metadata to the database. * * This service is called on every successful authentication (via /callback). * It handles: * - One-time initialization of firstLoginMethod and biUserId (write-once fields) * - Tracking the most recent login method in lastLoginMethod (updated every time) */ export declare class UserAuthInfoPersistenceService { private readonly store; private readonly tokenFacade; private readonly logger; constructor(store: DatabaseStore, tokenFacade: OwoxTokenFacade); /** * Persists authentication metadata from access token to the database. * * Called after every successful OAuth callback. Fields behavior: * - firstLoginMethod: set only if not already present (tracks original auth method) * - biUserId: set only if not already present (tracks original external user ID) * - lastLoginMethod: updated on every call (tracks most recent auth method) * * @param accessToken - The access token to extract information from */ persistAuthInfo(accessToken: string): Promise; /** * Extracts authentication information from token payload. * Maps token field names to database field names: * - userId (token) -> biUserId (database) * - signinProvider (token) -> firstLoginMethod (database) */ private extractAuthInfo; /** * Updates user's first login information in the database. * Only updates fields that are not already set (write-once behavior). */ private updateUserFirstLoginInfo; /** * Updates user's last login method in the database. * Updates every time (unlike firstLoginMethod which only sets once). */ private updateUserLastLoginInfo; } //# sourceMappingURL=user-auth-info-persistence-service.d.ts.map