Skip to main content

DatabaseInterface <CustomUser>

Hierarchy

Index

Methods

addEmail

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

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

    Returns Promise<void>

addEmailVerificationToken

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

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

    Returns Promise<void>

addLoginToken

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

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

    Returns Promise<void>

addResetPasswordToken

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

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

    Returns Promise<void>

createSession

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

    Returns Promise<string>

createUser

findPasswordHash

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

    • userId: string

    Returns Promise<null | string>

findSessionById

  • findSessionById(sessionId: string): Promise<null | Session>
  • Parameters

    • sessionId: string

    Returns Promise<null | Session>

findSessionByToken

  • findSessionByToken(token: string): Promise<null | Session>
  • Parameters

    • token: string

    Returns Promise<null | Session>

findUserByEmail

  • findUserByEmail(email: string): Promise<null | CustomUser>
  • Parameters

    • email: string

    Returns Promise<null | CustomUser>

findUserByEmailVerificationToken

  • findUserByEmailVerificationToken(token: string): Promise<null | CustomUser>
  • Parameters

    • token: string

    Returns Promise<null | CustomUser>

findUserById

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

    • userId: string

    Returns Promise<null | CustomUser>

findUserByLoginToken

  • findUserByLoginToken(token: string): Promise<null | CustomUser>
  • Parameters

    • token: string

    Returns Promise<null | CustomUser>

findUserByResetPasswordToken

  • findUserByResetPasswordToken(token: string): Promise<null | CustomUser>
  • Parameters

    • token: string

    Returns Promise<null | CustomUser>

findUserByServiceId

  • findUserByServiceId(serviceName: string, serviceId: string): Promise<null | CustomUser>
  • Parameters

    • serviceName: string
    • serviceId: string

    Returns Promise<null | CustomUser>

findUserByUsername

  • findUserByUsername(username: string): Promise<null | CustomUser>
  • Parameters

    • username: string

    Returns Promise<null | CustomUser>

invalidateAllSessions

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

    • userId: string
    • optionalexcludedSessionIds: string[]

    Returns Promise<void>

invalidateSession

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

    • sessionId: string

    Returns Promise<void>

removeAllLoginTokens

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

    • userId: string

    Returns Promise<void>

removeAllResetPasswordTokens

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

    • userId: string

    Returns Promise<void>

removeEmail

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

    • userId: string
    • email: string

    Returns Promise<void>

setPassword

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

    • userId: string
    • newPassword: string

    Returns Promise<void>

setService

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

    • userId: string
    • serviceName: string
    • data: object

    Returns Promise<void>

setUserDeactivated

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

    • userId: string
    • deactivated: boolean

    Returns Promise<void>

setUsername

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

    • userId: string
    • newUsername: string

    Returns Promise<void>

unsetService

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

    • userId: string
    • serviceName: string

    Returns Promise<void>

updateSession

  • Parameters

    Returns Promise<void>

verifyEmail

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

    • userId: string
    • email: string

    Returns Promise<void>