A EmailPasswordStore that uses a KeyValueStorage to persist its information and an ExpiringStorage to persist ForgotPassword records.

forgotPasswordExpiration parameter is how long the ForgotPassword record should be stored in minutes. (defaults to 15 minutes)

Hierarchy

  • BaseAccountStore

Implements

Constructors

Properties

forgotPasswordExpiration: number
forgotPasswordStorage: ExpiringStorage<string, EmailPasswordData>
saltRounds: number

Methods

  • Authenticate if the username and password are correct and return the WebID if it is. Throw an error if it is not.

    Returns

    The user's WebID.

    Parameters

    • email: string

      The user's email.

    • password: string

      This user's password.

    Returns Promise<string>

  • Deletes the Forgot Password Confirmation Record

    Parameters

    • recordId: string

      The record id of the forgot password confirmation record.

    Returns Promise<void>

  • Creates a Forgot Password Confirmation Record. This will be to remember that a user has made a request to reset a password. Throws an error if the email doesn't exist

    Returns

    The record id. This should be included in the reset password link.

    Parameters

    • email: string

      The user's email.

    Returns Promise<string>

  • Gets the email associated with the forgot password confirmation record or undefined if it's not present

    Returns

    The user's email.

    Parameters

    • recordId: string

      The record id retrieved from the link.

    Returns Promise<undefined | string>

  • Verifies the account creation. This can be used with, for example, e-mail verification. The account can only be used after it is verified. In case verification is not required, this should be called immediately after the create call.

    Parameters

    • email: string

      The account email.

    Returns Promise<void>