Interface PasswordStore

Responsible for storing everything related to email/password based login combinations.

Hierarchy

  • PasswordStore

Implemented by

Properties

authenticate: ((email, password) => Promise<{
    accountId: string;
    id: string;
}>)

Type declaration

    • (email, password): Promise<{
          accountId: string;
          id: string;
      }>
    • Authenticate if the email and password are correct and return the account and login ID if they are. Throw an error if they are not.

      Parameters

      • email: string

        The user's email.

      • password: string

        This user's password.

      Returns Promise<{
          accountId: string;
          id: string;
      }>

confirmVerification: ((id) => Promise<void>)

Type declaration

    • (id): Promise<void>
    • Confirms that the login has been verified. This can be used with, for example, email verification. The login can only be used after it is verified. In case verification is not required, this should be called immediately after the create call.

      Parameters

      • id: string

        ID of the login.

      Returns Promise<void>

create: ((email, accountId, password) => Promise<string>)

Type declaration

    • (email, accountId, password): Promise<string>
    • Creates a new login entry for this account.

      Parameters

      • email: string

        Email to log in with.

      • accountId: string

        Account ID.

      • password: string

        Password to authenticate with.

      Returns Promise<string>

delete: ((id) => Promise<void>)

Type declaration

    • (id): Promise<void>
    • Delete the login entry.

      Parameters

      • id: string

        ID of the login object.

      Returns Promise<void>

findByAccount: ((accountId) => Promise<{
    email: string;
    id: string;
}[]>)

Type declaration

    • (accountId): Promise<{
          email: string;
          id: string;
      }[]>
    • Find all login objects created by this account.

      Parameters

      • accountId: string

        ID of the account to find the logins for.

      Returns Promise<{
          email: string;
          id: string;
      }[]>

findByEmail: ((email) => Promise<undefined | {
    accountId: string;
    id: string;
}>)

Type declaration

    • (email): Promise<undefined | {
          accountId: string;
          id: string;
      }>
    • Finds the account and login ID associated with this email.

      Parameters

      • email: string

        Email to find the information for.

      Returns Promise<undefined | {
          accountId: string;
          id: string;
      }>

get: ((id) => Promise<undefined | {
    accountId: string;
    email: string;
}>)

Type declaration

    • (id): Promise<undefined | {
          accountId: string;
          email: string;
      }>
    • Finds the account and email associated with this login ID.

      Parameters

      • id: string

        The ID of the login object.

      Returns Promise<undefined | {
          accountId: string;
          email: string;
      }>

update: ((id, password) => Promise<void>)

Type declaration

    • (id, password): Promise<void>
    • Changes the password.

      Parameters

      • id: string

        ID of the login object.

      • password: string

        The new password.

      Returns Promise<void>