-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
68 lines (52 loc) · 1.5 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { EmailAdapter } from 'adminforth';
export interface PluginOptions {
/**
* Field name in auth resource which contains email
*/
emailField: string;
/**
* To work properly, this plugin requires a virtual password field in auth resource,
* which will define any constraints which determine the password strength (regex, minLength).
* When user will enter passowrd, it will be validated against this field constraints
* If you don't need it in backoffice itself, you can add it and set showIn = []
*/
passwordField: string;
/**
* Non-virtual field name in auth resource which contains password hash
*/
passwordHashField: string;
/**
* Default which will be assigned to user by default
* e.g. can be used to set default role
*/
defaultFieldValues?: {
[key: string]: any;
}
/**
* If not set user will not be asked for email confirmation (might be dangerous)
*/
confirmEmails?: {
/**
* A boolean field in auth resource which will be set to true when email is confirmed.
* Must have boolean type.
*/
emailConfirmedField: string;
/**
* From which email to send password reset emails
* e.g. [email protected]
* Example.com must be allowed in provider to send emails
*/
sendFrom: string;
/**
* Adapter to send emails
*/
adapter: EmailAdapter;
}
/**
* Hooks to be executed before and after user is created
*/
hooks?: {
beforeUserSave?: any;
afterUserSave?: any;
}
}