AccountsMikroOrm <CustomUser, CustomEmail, CustomSession, CustomService>
Constructors
- 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
- addEmail(userId: string, newEmail: string, verified: boolean): Promise<void>
Parameters
userId: string
newEmail: string
verified: boolean
Returns Promise<void>
- addEmailVerificationToken(userId: string, email: string, token: string): Promise<void>
Parameters
userId: string
email: string
token: string
Returns Promise<void>
- addLoginToken(userId: string, email: string, token: string): Promise<void>
Parameters
userId: string
email: string
token: string
Returns Promise<void>
- addResetPasswordToken(userId: string, email: string, token: string, reason: string): Promise<void>
Parameters
userId: string
email: string
token: string
reason: string
Returns Promise<void>
- createSession(userId: string, token: string, connection?: ConnectionInformations, extra?: object): Promise<string>
Parameters
userId: string
token: string
connection: ConnectionInformations = {}
optionalextra: object
Returns Promise<string>
- createUser(__namedParameters: CreateUser): Promise<string>
Parameters
__namedParameters: CreateUser
Returns Promise<string>
- findPasswordHash(userId: string): Promise<null | string>
Parameters
Returns Promise<null | string>
- findSessionById(sessionId: string): Promise<any>
Parameters
Returns Promise<any>
- findSessionByToken(token: string): Promise<any>
Parameters
Returns Promise<any>
- findUserByEmail(email: string): Promise<any>
Parameters
Returns Promise<any>
- findUserByEmailVerificationToken(token: string): Promise<any>
Parameters
Returns Promise<any>
- findUserById(userId: string): Promise<any>
Parameters
Returns Promise<any>
- findUserByLoginToken(token: string): Promise<any>
Parameters
Returns Promise<any>
- findUserByResetPasswordToken(token: string): Promise<any>
Parameters
Returns Promise<any>
- findUserByServiceId(serviceName: string, serviceId: string): Promise<any>
Parameters
serviceName: string
serviceId: string
Returns Promise<any>
- findUserByUsername(username: string): Promise<any>
Parameters
Returns Promise<any>
- invalidateAllSessions(userId: string, excludedSessionIds?: string[]): Promise<void>
Parameters
userId: string
optionalexcludedSessionIds: string[]
Returns Promise<void>
- invalidateSession(sessionId: string): Promise<void>
Parameters
Returns Promise<void>
- removeAllLoginTokens(userId: string): Promise<void>
Parameters
Returns Promise<void>
- removeAllResetPasswordTokens(userId: string): Promise<void>
Parameters
Returns Promise<void>
- removeEmail(userId: string, email: string): Promise<void>
Parameters
userId: string
email: string
Returns Promise<void>
- setPassword(userId: string, newPassword: string, flush?: boolean): Promise<void>
Parameters
userId: string
newPassword: string
flush: boolean = true
Returns Promise<void>
- setResetPassword(userId: string, email: string, newPassword: string): Promise<void>
Parameters
userId: string
email: string
newPassword: string
Returns Promise<void>
- 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>
- setUserDeactivated(userId: string, deactivated: boolean): Promise<void>
Parameters
userId: string
deactivated: boolean
Returns Promise<void>
- setUsername(userId: string, newUsername: string): Promise<void>
Parameters
userId: string
newUsername: string
Returns Promise<void>
- unsetService(userId: string, serviceName: string): Promise<void>
Parameters
userId: string
serviceName: string
Returns Promise<void>
- updateSession(sessionId: string, connection: ConnectionInformations): Promise<void>
Parameters
sessionId: string
connection: ConnectionInformations
Returns Promise<void>
- verifyEmail(userId: string, email: string): Promise<void>
Parameters
userId: string
email: string
Returns Promise<void>