Storage needed for the email-password interaction

Hierarchy

  • AccountStore

Implemented by

Properties

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

Type declaration

    • (email: string, password: string): Promise<string>
    • 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>

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

Type declaration

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

      Parameters

      • email: string

        The user's email.

      • password: string

        The user's password.

      Returns Promise<void>

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

Type declaration

    • (email: string, webId: string, password: string, settings: AccountSettings): 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: string) => Promise<void>)

Type declaration

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

      Parameters

      • email: string

        The user's email.

      Returns Promise<void>

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

Type declaration

    • (recordId: string): 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: string) => Promise<string>)

Type declaration

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

      Returns

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

      Parameters

      • email: string

        The user's email.

      Returns Promise<string>

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

Type declaration

    • (recordId: string): Promise<undefined | 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>

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

Type declaration

    • (webId: string): 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: string, settings: AccountSettings) => Promise<void>)

Type declaration

    • (webId: string, settings: AccountSettings): 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: string) => Promise<void>)

Type declaration

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