Options to customize the withPageAuthRequired higher order component.

Hierarchy

  • WithPageAuthRequiredOptions

Properties

onError?: ((error) => Element)

Type declaration

    • (error): Element
    • withPageAuthRequired(Profile, {
      onError: error => <div>Error: {error.message}</div>
      });

      Render a fallback in case of error fetching the user from the profile API route.

      Parameters

      • error: Error

      Returns Element

onRedirecting?: (() => Element)

Type declaration

    • (): Element
    • withPageAuthRequired(Profile, {
      onRedirecting: () => <div>Redirecting you to the login...</div>
      });

      Render a message to show that the user is being redirected to the login.

      Returns Element

returnTo?: string
withPageAuthRequired(Profile, {
returnTo: '/profile'
});

Add a path to return the user to after login.