Type parameters

CustomUser: User


  • AccountsServerOptions




Optional ambiguousErrorMessages

ambiguousErrorMessages? : boolean

Defined in packages/server/src/types/accounts-server-options.ts:14

Return ambiguous error messages from login failures to prevent user enumeration. Defaults to true.

Optional createJwtPayload

createJwtPayload? : function

Defined in packages/server/src/types/accounts-server-options.ts:45

Function to add addition information in jwt payload of accessToken

Type declaration:

▸ (data: JwtData, user: CustomUser): Promise‹Record‹string, any››



Optional createNewSessionTokenOnRefresh

createNewSessionTokenOnRefresh? : boolean

Defined in packages/server/src/types/accounts-server-options.ts:41

Creates a new session token each time a user refreshes his access token

Optional db

db? : DatabaseInterface‹CustomUser›

Defined in packages/server/src/types/accounts-server-options.ts:15

Optional emailTemplates

emailTemplates? : EmailTemplatesType

Defined in packages/server/src/types/accounts-server-options.ts:26

Optional enableAutologin

enableAutologin? : boolean

Defined in packages/server/src/types/accounts-server-options.ts:50

If this flag is set to true - user will be automatically logged in after registration. LoginResult data will be included into registration response.

Optional impersonationAuthorize

impersonationAuthorize? : function

Defined in packages/server/src/types/accounts-server-options.ts:28

Type declaration:

▸ (user: User, impersonateToUser: User): Promise‹any›



Optional prepareMail

prepareMail? : PrepareMailFunction

Defined in packages/server/src/types/accounts-server-options.ts:35

Optional resumeSessionValidator

resumeSessionValidator? : function

Defined in packages/server/src/types/accounts-server-options.ts:33

Use this function if you want to cancel the current session to be resumed. The session parameter will be null if the useStatelessSession option is set to true.

Type declaration:

▸ (user: User, session: Session): Promise‹void›



Optional sendMail

sendMail? : SendMailType

Defined in packages/server/src/types/accounts-server-options.ts:36

Optional siteUrl

siteUrl? : string

Defined in packages/server/src/types/accounts-server-options.ts:34

Optional tokenConfigs

tokenConfigs? : object

Defined in packages/server/src/types/accounts-server-options.ts:22

Type declaration:

  • accessToken? : SignOptions

  • refreshToken? : SignOptions

Optional tokenCreator

tokenCreator? : TokenCreator

Defined in packages/server/src/types/accounts-server-options.ts:37


tokenSecret: string | object

Defined in packages/server/src/types/accounts-server-options.ts:16

Optional useInternalUserObjectSanitizer

useInternalUserObjectSanitizer? : boolean

Defined in packages/server/src/types/accounts-server-options.ts:55

Set this false to false if you wish to skip internal user sanitazing method, and expose the original User object as-is.

Optional useStatelessSession

useStatelessSession? : boolean

Defined in packages/server/src/types/accounts-server-options.ts:65

Should the session mechanism be stateless. By default the token is checked against the database in every request. This allow you to revoke a session at any time. Since we are using JWT you can decide to have a stateless session. This means that the token won't be checked against the database on every request. Using the stateless approach will make the server authorisation check faster but this means that you won't be able to able to invalidate the access token until it's expired. Only use this option if you understand the downsides of this approach. Default 'false'.

Optional userObjectSanitizer

userObjectSanitizer? : UserObjectSanitizerFunction

Defined in packages/server/src/types/accounts-server-options.ts:27