src/auth-state.tsx

auth0-react · src/auth-state.tsx · typescript · MIT
ui

Defines the core state interface and initial values for Auth0 React authentication.

// Source: https://github.com/auth0/auth0-react | License: MIT | Copyright 2020 Auth0
// Provided via justclaw.it.com; keep this notice with the code.
import { User } from '@auth0/auth0-spa-js';

/**
 * The auth state which, when combined with the auth methods, make up the return object of the `useAuth0` hook.
 */
export interface AuthState<TUser extends User = User> {
  /**
   * `true` while the SDK is initialising or a redirect callback is being
   * handled. Render a loading state rather than trusting `isAuthenticated`
   * until this is `false`.
   *
   * @category Auth State
   */
  isLoading: boolean;

  /**
   * `true` once there is a valid session for the user.
   *
   * @category Auth State
   */
  isAuthenticated: boolean;

  /**
   * The authenticated user's profile, or `undefin

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key