UNPKG

nest-authify

Version:

Complete authentication and authorization package for NestJS - Monolith and Microservices ready with OAuth, JWT, Redis sessions

13 lines (12 loc) 662 B
import { AuthUser } from "./auth-options.interface"; export interface IAuthRepository { findUserByUsername(username: string): Promise<AuthUser | null>; findUserByEmail(email: string): Promise<AuthUser | null>; findUserById(id: string): Promise<AuthUser | null>; findUserByProviderId(provider: string, providerId: string): Promise<Omit<AuthUser, 'password'> | null>; createUser(data: Partial<AuthUser>): Promise<AuthUser>; updateUser(id: string, data: Partial<AuthUser>): Promise<AuthUser>; deleteUser?(id: string): Promise<void>; findUsersByRole?(role: string): Promise<AuthUser[]>; findActiveUsers?(): Promise<AuthUser[]>; }