Skip to main content

AccountsClient

Index

Constructors

constructor

Properties

publictransport

Methods

publicauthenticateWithService

  • authenticateWithService(service: string, credentials: {}): Promise<boolean>
  • Authenticate the user with a specific service (not creating a session)


    Parameters

    • service: string
    • credentials: {}

    Returns Promise<boolean>

publicclearTokens

  • clearTokens(original?: boolean): Promise<void>
  • Remove the tokens from the storage


    Parameters

    • optionaloriginal: boolean

    Returns Promise<void>

publicgetTokens

  • getTokens(original?: boolean): Promise<any>
  • Get the tokens from the storage


    Parameters

    • optionaloriginal: boolean

    Returns Promise<any>

publicgetUser

  • getUser(): Promise<User>
  • Get the user infos


    Returns Promise<User>

publicimpersonate

  • impersonate(impersonated: { email?: string; userId?: string; username?: string }): Promise<ImpersonationResult>
  • Impersonate to another user.


    Parameters

    • impersonated: { email?: string; userId?: string; username?: string }

    Returns Promise<ImpersonationResult>

publicloginWithService

  • loginWithService(service: string, credentials: {}): Promise<LoginResult>
  • Login the user with a specific service


    Parameters

    • service: string
    • credentials: {}

    Returns Promise<LoginResult>

publiclogout

  • logout(): Promise<void>
  • Logout the user Call the server to invalidate the tokens Clean user local storage


    Returns Promise<void>

publicrefreshSession

  • refreshSession(force?: boolean): Promise<any>
  • Refresh the user session If the tokens have expired try to refresh them


    Parameters

    • force: boolean = false

    Returns Promise<any>

publicsetTokens

  • setTokens(tokens: Tokens, original?: boolean): Promise<void>
  • Store the tokens in the storage


    Parameters

    • tokens: Tokens
    • optionaloriginal: boolean

    Returns Promise<void>

publicstopImpersonation

  • stopImpersonation(): Promise<void>
  • Stop the user impersonation.


    Returns Promise<void>