@easygov/react-components 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -263,6 +263,25 @@ interface SessionUser {
263
263
  sub: string;
264
264
  name: string;
265
265
  }
266
+ /**
267
+ * Lifecycle status of the OIDC session, orthogonal to the `current` payload.
268
+ *
269
+ * A route guard must key off this — NOT `user === null` — because a null user is
270
+ * ambiguous: it occurs during logout, token renewal, and a silent-renew blip, none
271
+ * of which mean "genuinely logged out". Only `unauthenticated` is a settled
272
+ * logged-out state that is safe to react to with a login redirect.
273
+ *
274
+ * - `initializing` — initSession() has not resolved yet.
275
+ * - `authenticated` — a valid session is present.
276
+ * - `renewing` — the access token expired / a silent renew is running; the
277
+ * previous session is kept until the renew resolves.
278
+ * - `signing-in` — requireSession() issued a login redirect; navigation pending.
279
+ * - `signing-out` — signOut() issued a logout redirect; navigation pending.
280
+ * - `unauthenticated`— settled logged out. THE ONLY state that warrants a login redirect.
281
+ * - `no-auth` — no OIDC authority configured / UserManager construction failed.
282
+ */
283
+ type AuthStatus = 'initializing' | 'authenticated' | 'renewing' | 'signing-in' | 'signing-out' | 'unauthenticated' | 'no-auth';
284
+ declare function getAuthStatus(): AuthStatus;
266
285
  declare function requireSession(): void;
267
286
 
268
287
  declare const dictionaries: {
@@ -310,6 +329,7 @@ interface EasygovSession {
310
329
  accessToken: string | null;
311
330
  }
312
331
  declare function useEasygovSession(): EasygovSession;
332
+ declare function useEasygovAuthStatus(): AuthStatus;
313
333
  interface EasygovHeaderProps {
314
334
  readonly locale?: Locale;
315
335
  readonly onLanguageChange?: (locale: Locale) => void;
@@ -323,4 +343,4 @@ interface RequireSessionProps {
323
343
  }
324
344
  declare function RequireSession({ children, fallback, loading, }: RequireSessionProps): React__default.JSX.Element;
325
345
 
326
- export { BrandBase, BrandEasygov, BrandFacebook, BrandKdk, BrandLinkedin, type BrandProps, BrandSeg, BrandSgv, BrandSsv, BrandSwiss, BrandXing, BrandYoutube, Button, type ButtonProps, type DesktopSpan, Dropdown, DropdownChip, DropdownChipsOverflow, type DropdownChipsOverflowProps, DropdownChipsTrigger, type DropdownChipsTriggerProps, DropdownCollection, DropdownEmpty, DropdownGroup, DropdownGroupLabel, DropdownHelperText, type DropdownHelperTextProps, DropdownInput, DropdownItem, type DropdownItemProps, DropdownItemText, DropdownLabel, type DropdownLabelProps, DropdownList, DropdownPopup, type DropdownPopupProps, DropdownSeparator, DropdownToggle, DropdownTrigger, type DropdownTriggerProps, DropdownValue, EasygovFooter, EasygovHeader, type EasygovHeaderProps, type EasygovSession, Grid, GridItem, type GridItemProps, type GridProps, Input, type InputProps, type Locale, type MobileSpan, NavigationMenu, NavigationMenuAnchor, type NavigationMenuAnchorProps, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, RequireSession, type RequireSessionProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, SelectHelperText, type SelectHelperTextProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, type SessionUser, type TabletSpan, TextLink, type TextLinkProps, buttonVariants, requireSession, textLinkVariants, useEasygovSession };
346
+ export { type AuthStatus, BrandBase, BrandEasygov, BrandFacebook, BrandKdk, BrandLinkedin, type BrandProps, BrandSeg, BrandSgv, BrandSsv, BrandSwiss, BrandXing, BrandYoutube, Button, type ButtonProps, type DesktopSpan, Dropdown, DropdownChip, DropdownChipsOverflow, type DropdownChipsOverflowProps, DropdownChipsTrigger, type DropdownChipsTriggerProps, DropdownCollection, DropdownEmpty, DropdownGroup, DropdownGroupLabel, DropdownHelperText, type DropdownHelperTextProps, DropdownInput, DropdownItem, type DropdownItemProps, DropdownItemText, DropdownLabel, type DropdownLabelProps, DropdownList, DropdownPopup, type DropdownPopupProps, DropdownSeparator, DropdownToggle, DropdownTrigger, type DropdownTriggerProps, DropdownValue, EasygovFooter, EasygovHeader, type EasygovHeaderProps, type EasygovSession, Grid, GridItem, type GridItemProps, type GridProps, Input, type InputProps, type Locale, type MobileSpan, NavigationMenu, NavigationMenuAnchor, type NavigationMenuAnchorProps, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, RequireSession, type RequireSessionProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, SelectHelperText, type SelectHelperTextProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, type SessionUser, type TabletSpan, TextLink, type TextLinkProps, buttonVariants, getAuthStatus, requireSession, textLinkVariants, useEasygovAuthStatus, useEasygovSession };