UNPKG

@raddiamond/nexauth-core

Version:

Core authentication plugin supporting Local, AD authentication

16 lines (15 loc) 680 B
export interface IdentityProvider<TUser = any> { getUser(username: string): Promise<TUser | null>; validatePassword(user: TUser, password: string): Promise<boolean>; } export interface OTPValidator<TUser = any> { isOTPRequired?: (user: TUser) => boolean; getSecret: (user: TUser) => string | null | undefined; validate?: (otp: string, secret: string) => boolean | Promise<boolean>; } export interface AuthStep<TUser = any> { name: string; isRequired(user?: TUser): boolean | Promise<boolean>; validate(input: any, user?: TUser, fullInput?: Record<string, any>): boolean | Promise<boolean>; getPrompt?(user?: TUser): string | Promise<string>; }