AccountsServerOptions

@accounts/serverGlobalsAccountsServerOptions

Type parameters

CustomUser: User

Hierarchy

  • AccountsServerOptions

Index

Properties

Properties

Optional ambiguousErrorMessages

ambiguousErrorMessages? : boolean

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

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:44

Function to add addition information in jwt payload of accessToken

Type declaration:

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

Parameters:

NameType
dataJwtData
userCustomUser

Optional createNewSessionTokenOnRefresh

createNewSessionTokenOnRefresh? : boolean

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

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:14


Optional emailTemplates

emailTemplates? : EmailTemplatesType

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


Optional enableAutologin

enableAutologin? : boolean

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

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:27

Type declaration:

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

Parameters:

NameType
userUser
impersonateToUserUser

Optional prepareMail

prepareMail? : PrepareMailFunction

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


Optional resumeSessionValidator

resumeSessionValidator? : function

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

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›

Parameters:

NameType
userUser
sessionSession

Optional sendMail

sendMail? : SendMailType

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


Optional siteUrl

siteUrl? : string

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


Optional tokenConfigs

tokenConfigs? : object

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

Type declaration:

  • accessToken? : SignOptions

  • refreshToken? : SignOptions


Optional tokenCreator

tokenCreator? : TokenCreator

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


tokenSecret

tokenSecret: string | object

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


Optional useInternalUserObjectSanitizer

useInternalUserObjectSanitizer? : boolean

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

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:64

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? : function

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

Type declaration:

▸ (user: CustomUser): CustomUser

Parameters:

NameType
userCustomUser