Skip to main content

Class: UserMongo

Defined in: src/models/mongo/UserMongo.ts:39

Implementation of the User interface for storage in a MongoDB database. If SQL is desired, please use models.sql.UserSQL instead.

Extends

  • BaseMongoEntity

Implements

Constructors

Constructor

new UserMongo(other?): UserMongo

Defined in: src/models/mongo/UserMongo.ts:65

Parameters

other?

Partial<UserMongo>

Returns

UserMongo

Overrides

BaseMongoEntity.constructor

Properties

_id?

optional _id?: any

Defined in: node_modules/@rapidrest/service-core/dist/types/models/BaseMongoEntity.d.ts:11

The internal unique identifier used by MongoDB.

Inherited from

BaseMongoEntity._id


dateCreated

dateCreated: Date

Defined in: node_modules/@rapidrest/service-core/dist/types/models/BaseEntity.d.ts:18

The date and time that the entity was created.

Implementation of

User.dateCreated

Inherited from

BaseMongoEntity.dateCreated


dateModified

dateModified: Date

Defined in: node_modules/@rapidrest/service-core/dist/types/models/BaseEntity.d.ts:22

The date and time that the entity was last modified.

Implementation of

User.dateModified

Inherited from

BaseMongoEntity.dateModified


requireMFA?

optional requireMFA?: boolean

Defined in: src/models/mongo/UserMongo.ts:43

Set to true to require multi-factor authentication for this account, otherwise set to false.

Default value is set by @Config("auth:require_mfa").

Implementation of

User.requireMFA


roles

roles: string[] = []

Defined in: src/models/mongo/UserMongo.ts:47

The list of roles (by name) that the user is a member of and will inherit the permissions of.

Implementation of

User.roles


scopes

scopes: string[] = []

Defined in: src/models/mongo/UserMongo.ts:51

The list of auth scopes that the user has been granted permission for.

Implementation of

User.scopes


sessionsRevokedAt?

optional sessionsRevokedAt?: number

Defined in: src/models/mongo/UserMongo.ts:59

The epoch-millisecond timestamp (see Date.now()) at which every refresh token issued for this account before that moment was revoked (see BaseAccountRoute.revokeSessions()/BaseAuthRefreshRoute). A refresh token whose iat claim predates this is rejected. Does not affect already-issued access tokens, which remain valid until their own natural (short) expiry regardless — see revokeSessions()'s doc comment for why that's an inherent limitation, not an oversight.

Implementation of

User.sessionsRevokedAt


uid

uid: string

Defined in: node_modules/@rapidrest/service-core/dist/types/models/BaseEntity.d.ts:14

The universally unique identifier of the entity.

Implementation of

User.uid

Inherited from

BaseMongoEntity.uid


verified

verified: boolean = false

Defined in: src/models/mongo/UserMongo.ts:63

Indicates if the user's e-mail address has been verified.

Implementation of

User.verified


version

version: number

Defined in: node_modules/@rapidrest/service-core/dist/types/models/BaseEntity.d.ts:26

The optimistic lock version.

Implementation of

User.version

Inherited from

BaseMongoEntity.version