IAuthRepository

Interface that defines the methods for the auth repository

interface IAuthRepository {
    comparePasswords(storedPassword: string, enteredPassword: string): Promise<boolean>;
    createUser(email: string, password: string): Promise<Document<unknown, any, any>>;
    deleteUser(email: string): Promise<DeleteResult>;
    findUserByEmail(email: string): Promise<null | IUser>;
}

Implemented by

Methods

  • Compare passwords

    Parameters

    • storedPassword: string

      The stored password

    • enteredPassword: string

      The entered password

    Returns Promise<boolean>

    • The comparison result
  • Create user

    Parameters

    • email: string

      The email

    • password: string

      The password

    Returns Promise<Document<unknown, any, any>>

    • The created user