Interface AccountStore

Storage needed for the email-password interaction

Hierarchy

  • AccountStore

Implemented by

Properties

authenticate: ((email, password) => Promise<string>)

Type declaration

    • (email, password): Promise<string>
    • Authenticate if the username and password are correct and return the WebID if it is. Throw an error if it is not.

      Parameters

      • email: string

        The user's email.

      • password: string

        This user's password.

      Returns Promise<string>

      The user's WebID.

changePassword: ((email, password) => Promise<void>)

Type declaration

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

      Parameters

      • email: string

        The user's email.

      • password: string

        The user's password.

      Returns Promise<void>

create: ((email, webId, password, settings) => Promise<void>)

Type declaration

    • (email, webId, password, settings): Promise<void>
    • Creates a new account.

      Parameters

      • email: string

        Account email.

      • webId: string

        Account WebID.

      • password: string

        Account password.

      • settings: AccountSettings

        Specific settings for the account.

      Returns Promise<void>

deleteAccount: ((email) => Promise<void>)

Type declaration

    • (email): Promise<void>
    • Delete the account.

      Parameters

      • email: string

        The user's email.

      Returns Promise<void>

deleteForgotPasswordRecord: ((recordId) => Promise<void>)

Type declaration

    • (recordId): Promise<void>
    • Deletes the Forgot Password Confirmation Record

      Parameters

      • recordId: string

        The record id of the forgot password confirmation record.

      Returns Promise<void>

generateForgotPasswordRecord: ((email) => Promise<string>)

Type declaration

    • (email): 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

      Parameters

      • email: string

        The user's email.

      Returns Promise<string>

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

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

Type declaration

    • (recordId): Promise<undefined | string>
    • Gets the email associated with the forgot password confirmation record or undefined if it's not present

      Parameters

      • recordId: string

        The record id retrieved from the link.

      Returns Promise<undefined | string>

      The user's email.

getSettings: ((webId) => Promise<AccountSettings>)

Type declaration

    • (webId): Promise<AccountSettings>
    • Gets the settings associated with this account. Errors if there is no matching account.

      Parameters

      • webId: string

        The account WebID.

      Returns Promise<AccountSettings>

updateSettings: ((webId, settings) => Promise<void>)

Type declaration

    • (webId, settings): Promise<void>
    • Updates the settings associated with this account.

      Parameters

      • webId: string

        The account WebID.

      • settings: AccountSettings

        New settings for the account.

      Returns Promise<void>

verify: ((email) => Promise<void>)

Type declaration

    • (email): Promise<void>
    • 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>