Skip to main content

MongoServiceMagicLink

Implements

  • unknown

Index

Constructors

constructor

Methods

publicaddLoginToken

  • addLoginToken(userId: string, email: string, token: string): Promise<void>
  • Add a login token to a user.


    Parameters

    • userId: string

      Id used to update the user.

    • email: string

      Which address of the user's to link the token to.

    • token: string

      Random token used to allow user to login.

    Returns Promise<void>

publicfindUserByLoginToken

  • findUserByLoginToken(token: string): Promise<any>
  • Find a user from a login token.


    Parameters

    • token: string

      Random token used to allow user to login.

    Returns Promise<any>

publicremoveAllLoginTokens

  • removeAllLoginTokens(userId: string): Promise<void>
  • Remove all the login tokens for a user.


    Parameters

    • userId: string

      Id used to update the user.

    Returns Promise<void>

publicsetupIndexes

  • setupIndexes(options?: Omit<CreateIndexesOptions, unique | sparse>): Promise<void>
  • Setup the mongo indexes needed for the token service.


    Parameters

    • options: Omit<CreateIndexesOptions, unique | sparse> = {}

      Options passed to the mongo native createIndex method.

    Returns Promise<void>