Constructors
Parameters
optionalconnection: Connection
UserEntity: typeof User = User
UserEmailEntity: typeof UserEmail = UserEmail
UserServiceEntity: typeof UserService = UserService
UserSessionEntity: typeof UserSession = UserSession
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(createUser: CreateUser): Promise<string>
Parameters
Returns Promise<string>
- findPasswordHash(userId: string): Promise<null | string>
Parameters
Returns Promise<null | string>
- findSessionById(sessionId: string): Promise<null | UserSession>
- findSessionByToken(token: string): Promise<null | UserSession>
- findUserByEmail(email: string): Promise<null | User>
Parameters
Returns Promise<null | User>
- findUserByEmailVerificationToken(token: string): Promise<null | User>
Parameters
Returns Promise<null | User>
- findUserById(userId: string): Promise<null | User>
Parameters
Returns Promise<null | User>
- findUserByLoginToken(token: string): Promise<null | User>
Parameters
Returns Promise<null | User>
- findUserByResetPasswordToken(token: string): Promise<null | User>
Parameters
Returns Promise<null | User>
- findUserByServiceId(serviceName: string, serviceId: string): Promise<null | User>
Parameters
serviceName: string
serviceId: string
Returns Promise<null | User>
- findUserByUsername(username: string): Promise<null | User>
Parameters
Returns Promise<null | User>
- getService(userId: string, serviceName: string): Promise<null | UserService>
Parameters
userId: string
serviceName: string
Returns Promise<null | UserService>
- 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): Promise<void>
Parameters
userId: string
newPassword: string
Returns Promise<void>
- setService(userId: string, serviceName: string, data: object, token?: string): Promise<void>
Parameters
userId: string
serviceName: string
data: object
optionaltoken: string
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>