Skip to main content

AccountsMikroOrm <CustomUser, CustomEmail, CustomSession, CustomService>

Implements

  • unknown

Index

Constructors

constructor

  • new AccountsMikroOrm<CustomUser, CustomEmail, CustomSession, CustomService>(EmailEntity?: Constructor<CustomEmail | Email<any>>, ServiceEntity?: Constructor<CustomService | Service<any>>, SessionEntity?: Constructor<CustomSession | Session<any>>, UserEntity?: Constructor<CustomUser | IUser<any, any, any>>): AccountsMikroOrm<CustomUser, CustomEmail, CustomSession, CustomService>
  • Type parameters

    Parameters

    • optionalEmailEntity: Constructor<CustomEmail | Email<any>>
    • optionalServiceEntity: Constructor<CustomService | Service<any>>
    • optionalSessionEntity: Constructor<CustomSession | Session<any>>
    • optionalUserEntity: Constructor<CustomUser | IUser<any, any, any>>

    Returns AccountsMikroOrm<CustomUser, CustomEmail, CustomSession, CustomService>

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, extra?: object): Promise<string>
  • Parameters

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

    Returns Promise<string>

publiccreateUser

  • createUser(__namedParameters: CreateUser): Promise<string>
  • Parameters

    • __namedParameters: CreateUser

    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, flush?: boolean): Promise<void>
  • Parameters

    • userId: string
    • newPassword: string
    • flush: boolean = true

    Returns Promise<void>

publicsetResetPassword

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

    • userId: string
    • email: string
    • newPassword: string

    Returns Promise<void>

publicsetService

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

    • userId: string
    • serviceName: string
    • data: object
    • optionaltoken: string
    • flush: boolean = true

    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>

publicunsetService

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

    • userId: string
    • serviceName: string

    Returns Promise<void>

publicupdateSession

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

    • sessionId: string
    • connection: ConnectionInformations

    Returns Promise<void>

publicverifyEmail

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

    • userId: string
    • email: string

    Returns Promise<void>