@accounts/server

@accounts/serverGlobals

Index

Enumerations

Classes

Interfaces

Type aliases

Functions

Object literals

Type aliases

EmailType

Ƭ EmailType: EmailTemplateType & object

Defined in packages/server/src/types/email-type.ts:3


PrepareMailFunction

Ƭ PrepareMailFunction: function

Defined in packages/server/src/types/prepare-mail-function.ts:4

Type declaration:

▸ (to: string, token: string, user: User, pathFragment: string, emailTemplate: EmailTemplateType, from: string): object

Parameters:

NameType
tostring
tokenstring
userUser
pathFragmentstring
emailTemplateEmailTemplateType
fromstring

ResumeSessionValidator

Ƭ ResumeSessionValidator: function

Defined in packages/server/src/types/resume-session-validator.ts:3

Type declaration:

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

Parameters:

NameType
userUser
sessionSession

SendMailType

Ƭ SendMailType: function

Defined in packages/server/src/utils/email.ts:36

Defined in packages/server/src/types/send-mail-type.ts:1

Type declaration:

▸ (mail: any): Promise‹void›

Parameters:

NameType
mailany

UserObjectSanitizerFunction

Ƭ UserObjectSanitizerFunction: function

Defined in packages/server/src/types/user-object-sanitizer-function.ts:3

Type declaration:

▸ (userObject: User, omitFunction: function, pickFunction: function): any

Parameters:

userObject: User

omitFunction: function

▸ (userDoc: object, fields: string[]): User

Parameters:

NameType
userDocobject
fieldsstring[]

pickFunction: function

▸ (userDoc: object, fields: string[]): User

Parameters:

NameType
userDocobject
fieldsstring[]

Functions

Const generateAccessToken

generateAccessToken(__namedParameters: object): string

Defined in packages/server/src/utils/tokens.ts:9

Parameters:

__namedParameters: object

NameType
configSignOptions
payloadany
secretstring | Buffer‹› | object

Returns: string


Const generateRandomToken

generateRandomToken(length: number): string

Defined in packages/server/src/utils/tokens.ts:7

Generate a random token string

Parameters:

NameTypeDefault
lengthnumber43

Returns: string


Const generateRefreshToken

generateRefreshToken(__namedParameters: object): string

Defined in packages/server/src/utils/tokens.ts:19

Parameters:

__namedParameters: object

NameType
configSignOptions
payloadany
secretstring | Buffer‹› | object

Returns: string


getFirstUserEmail

getFirstUserEmail(user: User, address: string): string

Defined in packages/server/src/utils/get-first-user-email.ts:4

Parameters:

NameType
userUser
addressstring

Returns: string


Const sendMail

sendMail(mail: object): Promise‹void›

Defined in packages/server/src/utils/email.ts:38

Parameters:

NameType
mailobject

Returns: Promise‹void›

Object literals

Const ServerHooks

ServerHooks: object

Defined in packages/server/src/utils/server-hooks.ts:1

AuthenticateError

AuthenticateError: string = "AuthenticateError"

Defined in packages/server/src/utils/server-hooks.ts:6

AuthenticateSuccess

AuthenticateSuccess: string = "AuthenticateSuccess"

Defined in packages/server/src/utils/server-hooks.ts:5

ChangePasswordSuccess

ChangePasswordSuccess: string = "ChangePasswordSuccess"

Defined in packages/server/src/utils/server-hooks.ts:18

CreateUserError

CreateUserError: string = "CreateUserError"

Defined in packages/server/src/utils/server-hooks.ts:10

CreateUserSuccess

CreateUserSuccess: string = "CreateUserSuccess"

Defined in packages/server/src/utils/server-hooks.ts:9

ImpersonationError

ImpersonationError: string = "ImpersonationError"

Defined in packages/server/src/utils/server-hooks.ts:16

ImpersonationSuccess

ImpersonationSuccess: string = "ImpersonationSuccess"

Defined in packages/server/src/utils/server-hooks.ts:15

LoginError

LoginError: string = "LoginError"

Defined in packages/server/src/utils/server-hooks.ts:4

LoginSuccess

LoginSuccess: string = "LoginSuccess"

Defined in packages/server/src/utils/server-hooks.ts:3

LogoutError

LogoutError: string = "LogoutError"

Defined in packages/server/src/utils/server-hooks.ts:8

LogoutSuccess

LogoutSuccess: string = "LogoutSuccess"

Defined in packages/server/src/utils/server-hooks.ts:7

RefreshTokensError

RefreshTokensError: string = "RefreshTokensError"

Defined in packages/server/src/utils/server-hooks.ts:14

RefreshTokensSuccess

RefreshTokensSuccess: string = "RefreshTokensSuccess"

Defined in packages/server/src/utils/server-hooks.ts:13

ResetPasswordSuccess

ResetPasswordSuccess: string = "ResetPasswordSuccess"

Defined in packages/server/src/utils/server-hooks.ts:17

ResumeSessionError

ResumeSessionError: string = "ResumeSessionError"

Defined in packages/server/src/utils/server-hooks.ts:12

ResumeSessionSuccess

ResumeSessionSuccess: string = "ResumeSessionSuccess"

Defined in packages/server/src/utils/server-hooks.ts:11

ValidateLogin

ValidateLogin: string = "ValidateLogin"

Defined in packages/server/src/utils/server-hooks.ts:2


Const defaultOptions

defaultOptions: object

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

ambiguousErrorMessages

ambiguousErrorMessages: boolean = true

Defined in packages/server/src/accounts-server.ts:38

createNewSessionTokenOnRefresh

createNewSessionTokenOnRefresh: boolean = false

Defined in packages/server/src/accounts-server.ts:52

emailTemplates

emailTemplates: EmailTemplatesType

Defined in packages/server/src/accounts-server.ts:48

sendMail

sendMail: sendMail

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

siteUrl

siteUrl: string = "http://localhost:3000"

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

tokenSecret

tokenSecret: string = "secret"

Defined in packages/server/src/accounts-server.ts:39

useInternalUserObjectSanitizer

useInternalUserObjectSanitizer: boolean = true

Defined in packages/server/src/accounts-server.ts:53

userObjectSanitizer

userObjectSanitizer(user: User): User

Defined in packages/server/src/accounts-server.ts:51

Parameters:

NameType
userUser

Returns: User

tokenConfigs: object

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

  • accessToken: object

    • expiresIn: string = "90m"
  • refreshToken: object

    • expiresIn: string = "7d"

Const emailTemplates

emailTemplates: object

Defined in packages/server/src/utils/email.ts:4

from

from: string = "accounts-js no-reply@accounts-js.com"

Defined in packages/server/src/utils/email.ts:5

enrollAccount: object

Defined in packages/server/src/utils/email.ts:22

  • html(user: User, url: string): string

  • subject(): string

  • text(user: User, url: string): string

passwordChanged: object

Defined in packages/server/src/utils/email.ts:29

  • html(): string

  • subject(): string

  • text(): string

resetPassword: object

Defined in packages/server/src/utils/email.ts:15

  • html(user: User, url: string): string

  • subject(): string

  • text(user: User, url: string): string

verifyEmail: object

Defined in packages/server/src/utils/email.ts:7

  • html(user: User, url: string): string

  • subject(): string

  • text(user: User, url: string): string