Class

UserClient

UserClient()

A class to manage user information.
Constructor

# new UserClient()

View Source lib/client/UserClient.ts, line 11

Extends

Members

Methods

# async create(email) → {Promise.<UserCreated>}

Creates a new user. Afterwards, verify the email address via passcode. If a 'ConflictError' occurred, you may want to prompt the user to log in.
Parameters:
Name Type Description
email string The email address of the user to be created.
See:

View Source lib/client/UserClient.ts, line 168

Promise.<UserCreated>

# async delete() → {Promise.<void>}

Deletes the current user and expires the existing session cookie.

View Source lib/client/UserClient.ts, line 192

Promise.<void>

# async getInfo(email) → {Promise.<UserInfo>}

Fetches basic information about the user identified by the given email address. Can be used while the user is logged out and is helpful in deciding which type of login to choose. For example, if the user's email is not verified, you may want to log in with a passcode, or if no WebAuthn credentials are registered, you may not want to use WebAuthn.
Parameters:
Name Type Description
email string The user's email address.
See:

View Source lib/client/UserClient.ts, line 154

Promise.<UserInfo>

# async logout() → {Promise.<void>}

Logs out the current user and expires the existing session cookie. A valid session cookie is required to call the logout endpoint.

View Source lib/client/UserClient.ts, line 202

Promise.<void>