Skip to main content

Mongo

Implements

  • unknown

Index

Constructors

constructor

Methods

publicaddEmail

  • addEmail(userId: string, newEmail: string, verified: boolean): Promise<void>
  • Parameters

    • userId: string
    • newEmail: string
    • verified: boolean

    Returns Promise<void>

publicaddEmailVerificationToken

  • addEmailVerificationToken(userId: string, email: string, token: string): Promise<void>
  • Parameters

    • userId: string
    • email: string
    • token: string

    Returns Promise<void>

publicaddLoginToken

  • addLoginToken(userId: string, email: string, token: string): Promise<void>
  • Parameters

    • userId: string
    • email: string
    • token: string

    Returns Promise<void>

publicaddResetPasswordToken

  • addResetPasswordToken(userId: string, email: string, token: string, reason: string): Promise<void>
  • Parameters

    • userId: string
    • email: string
    • token: string
    • reason: string

    Returns Promise<void>

publiccreateSession

  • createSession(userId: string, token: string, connection?: ConnectionInformations, extraData?: object): Promise<string>
  • Parameters

    • userId: string
    • token: string
    • connection: ConnectionInformations = {}
    • optionalextraData: object

    Returns Promise<string>

publiccreateUser

  • createUser(user: CreateUserServicePassword): Promise<string>
  • Parameters

    • user: CreateUserServicePassword

    Returns Promise<string>

publicfindPasswordHash

  • findPasswordHash(userId: string): Promise<null | string>
  • Parameters

    • userId: string

    Returns Promise<null | string>

publicfindSessionById

  • findSessionById(sessionId: string): Promise<any>
  • Parameters

    • sessionId: string

    Returns Promise<any>

publicfindSessionByToken

  • findSessionByToken(token: string): Promise<any>
  • Parameters

    • token: string

    Returns Promise<any>

publicfindUserByEmail

  • findUserByEmail(email: string): Promise<any>
  • Parameters

    • email: string

    Returns Promise<any>

publicfindUserByEmailVerificationToken

  • findUserByEmailVerificationToken(token: string): Promise<any>
  • Parameters

    • token: string

    Returns Promise<any>

publicfindUserById

  • findUserById(userId: string): Promise<any>
  • Parameters

    • userId: string

    Returns Promise<any>

publicfindUserByLoginToken

  • findUserByLoginToken(token: string): Promise<any>
  • Parameters

    • token: string

    Returns Promise<any>

publicfindUserByResetPasswordToken

  • findUserByResetPasswordToken(token: string): Promise<any>
  • Parameters

    • token: string

    Returns Promise<any>

publicfindUserByServiceId

  • findUserByServiceId(serviceName: string, serviceId: string): Promise<any>
  • Parameters

    • serviceName: string
    • serviceId: string

    Returns Promise<any>

publicfindUserByUsername

  • findUserByUsername(username: string): Promise<any>
  • Parameters

    • username: string

    Returns Promise<any>

publicinvalidateAllSessions

  • invalidateAllSessions(userId: string, excludedSessionIds?: string[]): Promise<void>
  • Parameters

    • userId: string
    • optionalexcludedSessionIds: string[]

    Returns Promise<void>

publicinvalidateSession

  • invalidateSession(sessionId: string): Promise<void>
  • Parameters

    • sessionId: string

    Returns Promise<void>

publicremoveAllLoginTokens

  • removeAllLoginTokens(userId: string): Promise<void>
  • Parameters

    • userId: string

    Returns Promise<void>

publicremoveAllResetPasswordTokens

  • removeAllResetPasswordTokens(userId: string): Promise<void>
  • Parameters

    • userId: string

    Returns Promise<void>

publicremoveEmail

  • removeEmail(userId: string, email: string): Promise<void>
  • Parameters

    • userId: string
    • email: string

    Returns Promise<void>

publicsetPassword

  • setPassword(userId: string, newPassword: string): Promise<void>
  • Parameters

    • userId: string
    • newPassword: string

    Returns Promise<void>

publicsetService

  • setService(userId: string, serviceName: string, service: object): Promise<void>
  • Parameters

    • userId: string
    • serviceName: string
    • service: object

    Returns Promise<void>

publicsetUserDeactivated

  • setUserDeactivated(userId: string, deactivated: boolean): Promise<void>
  • Parameters

    • userId: string
    • deactivated: boolean

    Returns Promise<void>

publicsetUsername

  • setUsername(userId: string, newUsername: string): Promise<void>
  • Parameters

    • userId: string
    • newUsername: string

    Returns Promise<void>

publicsetupIndexes

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


    Parameters

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

      Options passed to the mongo native createIndex method.

    Returns Promise<void>

publicunsetService

  • unsetService(userId: string, serviceName: string): Promise<void>
  • Parameters

    • userId: string
    • serviceName: string

    Returns Promise<void>

publicupdateSession

  • updateSession(sessionId: string, connection: ConnectionInformations, newToken?: string): Promise<void>
  • Parameters

    • sessionId: string
    • connection: ConnectionInformations
    • optionalnewToken: string

    Returns Promise<void>

publicverifyEmail

  • verifyEmail(userId: string, email: string): Promise<void>
  • Parameters

    • userId: string
    • email: string

    Returns Promise<void>