Skip to content

Components · Reference

KrakstackAuthRequired

Wait for auth project configuration before rendering a route.

Preview

Loading preview…

Usage

tsx
import { KrakstackAuthRequired } from "@krak-stack/auth/auth-provider/react";
import type { ReactNode } from "react";
import { Loading } from "@krak-stack/registry/loading";

export const Example = ({ children }: { children: ReactNode }) => (
  <KrakstackAuthRequired fallback={<Loading />}>
    {children}
  </KrakstackAuthRequired>
);

Use this boundary inside KrakstackAuthProvider. It shows fallback while configuration loads and passes configuration failures to the nearest error boundary when no cached configuration is available. It does not require the visitor to be signed in.