Skip to main content

@accounts/server

@accounts/server › Globals

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

SendMailType

Ƭ SendMailType: function

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

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

Type declaration:

▸ (mail: any): Promise‹void›

Parameters:

NameType
mailany

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

Parameters:

NameType
userUser
addressstring

Returns: string


Const isString

▸ isString(x: any): x is string

Defined in packages/server/src/utils/validation.ts:1

Parameters:

NameType
xany

Returns: x is string


Const sendMail

▸ sendMail(mail: object): Promise‹void›

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

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

ambiguousErrorMessages

• ambiguousErrorMessages: boolean = true

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

createNewSessionTokenOnRefresh

• createNewSessionTokenOnRefresh: boolean = false

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

emailTemplates

• emailTemplates: EmailTemplatesType

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

sendMail

• sendMail: sendMail

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

siteUrl

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

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

tokenSecret

• tokenSecret: string | object = 'secret' as | string | { publicKey: jwt.Secret; privateKey: jwt.Secret; }

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

useInternalUserObjectSanitizer

• useInternalUserObjectSanitizer: boolean = true

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

useStatelessSession

• useStatelessSession: boolean = false

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

userObjectSanitizer

▸ userObjectSanitizer(user: User): User

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

Parameters:

NameType
userUser

Returns: User

▪ tokenConfigs: object

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

  • 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

▪ magicLink: object

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

  • 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