import { PROVIDER_REAL_USER } from '../../../src/symbols.ts'; import type { BasicAuthGuardUser, LucidAuthenticatable, BasicAuthUserProviderContract, BasicAuthLucidUserProviderOptions } from '../types.ts'; /** * Uses a Lucid model to verify access tokens and find a user during * authentication * * @template UserModel - The Lucid model representing the user * * @example * const userProvider = new BasicAuthLucidUserProvider({ * model: () => import('#models/user') * }) */ export declare class BasicAuthLucidUserProvider implements BasicAuthUserProviderContract> { /** * Lucid provider options */ protected options: BasicAuthLucidUserProviderOptions; [PROVIDER_REAL_USER]: InstanceType; /** * Reference to the lazily imported model */ protected model?: UserModel; /** * Creates a new BasicAuthLucidUserProvider instance * * @param options - Configuration options for the user provider * * @example * const provider = new BasicAuthLucidUserProvider({ * model: () => import('#models/user') * }) */ constructor( /** * Lucid provider options */ options: BasicAuthLucidUserProviderOptions); /** * Imports the model from the provider, returns and caches it * for further operations. * * @example * const UserModel = await provider.getModel() * const user = await UserModel.find(1) */ protected getModel(): Promise; /** * Creates an adapter user for the guard * * @param user - The user model instance * * @example * const guardUser = await provider.createUserForGuard(user) * console.log('User ID:', guardUser.getId()) */ createUserForGuard(user: InstanceType): Promise>>; /** * Verifies credentials using the underlying model * * @param uid - The username or user identifier * @param password - The password to verify * * @example * const guardUser = await provider.verifyCredentials('user@example.com', 'secret') * if (guardUser) { * console.log('Valid credentials') * } */ verifyCredentials(uid: string, password: string): Promise> | null>; }