Interface for the AuthService class

interface IAuthService {
    deleteUser(email: string): Promise<DeleteResult>;
    loginUser(email: string, password: string): Promise<IUser>;
    registerUser(email: string, password: string): Promise<Document<unknown, any, any>>;
}

Implemented by

Methods

  • Deletes a user

    Parameters

    • email: string

      The email of the user

    Returns Promise<DeleteResult>

    The result of the deletion

  • Logs in a user

    Parameters

    • email: string

      The email of the user

    • password: string

      The password of the user

    Returns Promise<IUser>

    The logged in user

    If the credentials are invalid

  • Registers a new user

    Parameters

    • email: string

      The email of the user

    • password: string

      The password of the user

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

    The created user

    If the user already exists