Options
All
  • Public
  • Public/Protected
  • All
Menu

A set of methods for retrieving or modifying the authentication state of a StitchAppClient. An implementation can be instantiated with a StitchAppClient instance.

Hierarchy

  • StitchAuth

Index

Properties

isLoggedIn

isLoggedIn: boolean

Whether or not the client containing this StitchAuth object is currently authenticated.

Optional user

A StitchUser object representing the user that the client is currently authenticated as. undefined if the client is not currently authenticated.

Methods

addAuthListener

getProviderClient

  • getProviderClient<ClientT>(factory: AuthProviderClientFactory<ClientT>): ClientT
  • getProviderClient<T>(factory: NamedAuthProviderClientFactory<T>, providerName: string): T
  • Retrieves the authentication provider client for the authentication provider associated with the specified factory.

    Type parameters

    • ClientT

    Parameters

    • factory: AuthProviderClientFactory<ClientT>

      The factory that produces the desired client.

    Returns ClientT

  • Retrieves the authentication provider client for the authentication provider associated with the specified factory and auth provider name.

    Type parameters

    • T

    Parameters

    • factory: NamedAuthProviderClientFactory<T>

      The factory that produces the desired client.

    • providerName: string

    Returns T

handleRedirectResult

hasRedirectResult

  • hasRedirectResult(): boolean

loginWithCredential

  • loginWithCredential(credential: StitchCredential): Promise<StitchUser>

loginWithRedirect

  • Authenticates the client as a MongoDB Stitch user using the provided StitchRedirectCredential. This method will redirect the user to an OAuth2 login page where the login is handled externally. That external page will redirect the user back to the page specified in the redirect credential. To complete the login, that page will need to handle the redirect by calling {@link handleRedirectResult()}.

    Parameters

    Returns void

logout

  • logout(): Promise<void>

removeAuthListener

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc