User
The IUser interface represents the User object stored in the collection users
1
interface IUser {
2
_id: string;
3
createdAt: Date;
4
roles: string[];
5
type: string;
6
active: boolean;
7
username?: string;
8
name?: string;
9
services?: IUserServices;
10
emails?: IUserEmail[];
11
status?: string;
12
statusConnection?: string;
13
lastLogin?: Date;
14
avatarOrigin?: string;
15
utcOffset?: number;
16
language?: string;
17
statusDefault?: string;
18
oauth?: {
19
authorizedClients: string[];
20
};
21
_updatedAt?: Date;
22
statusLivechat?: string;
23
e2e?: {
24
private_key: string;
25
public_key: string;
26
};
27
requirePasswordChange?: boolean;
28
customFields?: {
29
[key: string]: any;
30
};
31
settings?: IUserSettings;
32
}
Copied!
The following sub-interfaces are used by the IUser interface
1
interface ILoginToken {
2
hashedToken: string;
3
twoFactorAuthorizedUntil?: Date;
4
twoFactorAuthorizedHash?: string;
5
}
6
7
interface IMeteorLoginToken extends ILoginToken {
8
when: Date;
9
}
10
11
interface IPersonalAccessToken extends ILoginToken {
12
type: 'personalAccessToken';
13
createdAt: Date;
14
lastTokenPart: string;
15
name?: string;
16
bypassTwoFactor?: boolean;
17
}
18
19
interface IUserEmailVerificationToken {
20
token: string;
21
address: string;
22
when: Date;
23
}
24
25
interface IUserEmailCode {
26
code: string;
27
expire: Date;
28
}
29
30
type LoginToken = ILoginToken & IPersonalAccessToken;
31
32
interface IUserServices {
33
password?: {
34
bcrypt: string;
35
};
36
email?: {
37
verificationTokens?: IUserEmailVerificationToken[];
38
};
39
resume?: {
40
loginTokens?: LoginToken[];
41
};
42
google?: any;
43
facebook?: any;
44
github?: any;
45
totp?: {
46
enabled: boolean;
47
hashedBackup: string[];
48
secret: string;
49
};
50
email2fa?: {
51
enabled: boolean;
52
changedAt: Date;
53
};
54
emailCode: IUserEmailCode[];
55
}
56
57
interface IUserEmail {
58
address: string;
59
verified: boolean;
60
}
61
62
interface IUserSettings {
63
profile: any;
64
preferences: {
65
[key: string]: any;
66
};
67
}
Copied!
Last modified 8mo ago
Export as PDF
Copy link
Edit on GitHub