AccountsClient

@accounts/clientGlobalsAccountsClient

Hierarchy

  • AccountsClient

Index

Constructors

Properties

Methods

Constructors

constructor

+ new AccountsClient(options: AccountsClientOptions, transport: TransportInterface): AccountsClient

Defined in accounts-client.ts:22

Parameters:

NameType
optionsAccountsClientOptions
transportTransportInterface

Returns: AccountsClient

Properties

transport

transport: TransportInterface

Defined in accounts-client.ts:20

Methods

authenticateWithService

authenticateWithService(service: string, credentials: object): Promise‹boolean›

Defined in accounts-client.ts:92

Authenticate the user with a specific service (not creating a session)

Parameters:

NameType
servicestring
credentialsobject

Returns: Promise‹boolean›


clearTokens

clearTokens(original?: boolean): Promise‹void›

Defined in accounts-client.ts:76

Remove the tokens from the storage

Parameters:

NameType
original?boolean

Returns: Promise‹void›


getTokens

getTokens(original?: boolean): Promise‹Tokens | null›

Defined in accounts-client.ts:38

Get the tokens from the storage

Parameters:

NameType
original?boolean

Returns: Promise‹Tokens | null›


getUser

getUser(): Promise‹User›

Defined in accounts-client.ts:184

Get the user infos

Returns: Promise‹User›


impersonate

impersonate(impersonated: object): Promise‹ImpersonationResult›

Defined in accounts-client.ts:148

Impersonate to another user.

Parameters:

impersonated: object

NameType
email?string
userId?string
username?string

Returns: Promise‹ImpersonationResult›


loginWithService

loginWithService(service: string, credentials: object): Promise‹LoginResult›

Defined in accounts-client.ts:102

Login the user with a specific service

Parameters:

NameType
servicestring
credentialsobject

Returns: Promise‹LoginResult›


logout

logout(): Promise‹void›

Defined in accounts-client.ts:193

Logout the user Call the server to invalidate the tokens Clean user local storage

Returns: Promise‹void›


refreshSession

refreshSession(force: boolean): Promise‹Tokens | null›

Defined in accounts-client.ts:115

Refresh the user session If the tokens have expired try to refresh them

Parameters:

NameTypeDefault
forcebooleanfalse

Returns: Promise‹Tokens | null›


setTokens

setTokens(tokens: Tokens, original?: boolean): Promise‹void›

Defined in accounts-client.ts:58

Store the tokens in the storage

Parameters:

NameType
tokensTokens
original?boolean

Returns: Promise‹void›


stopImpersonation

stopImpersonation(): Promise‹void›

Defined in accounts-client.ts:173

Stop the user impersonation.

Returns: Promise‹void›