Interface ForgotPasswordStore

Responsible for storing the records that are used when a user forgets their password.

interface ForgotPasswordStore {
    delete: ((recordId: string) => Promise<boolean>);
    generate: ((id: string) => Promise<string>);
    get: ((recordId: string) => Promise<undefined | string>);
}

Implemented by

Properties

Properties

delete: ((recordId: string) => Promise<boolean>)

Deletes the Forgot Password Confirmation Record.

Type declaration

    • (recordId): Promise<boolean>
    • Parameters

      • recordId: string

        The record id of the forgot password confirmation record.

      Returns Promise<boolean>

generate: ((id: string) => Promise<string>)

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.

Type declaration

    • (id): Promise<string>
    • Parameters

      • id: string

        ID of the email/password login object.

      Returns Promise<string>

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

get: ((recordId: string) => Promise<undefined | string>)

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

Type declaration

    • (recordId): Promise<undefined | string>
    • Parameters

      • recordId: string

        The record id retrieved from the link.

      Returns Promise<undefined | string>

      The user's email.