@easygov/react-components 0.2.5 → 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.
- package/README.md +1 -0
- package/dist/easygov.d.mts +21 -1
- package/dist/easygov.mjs +1 -1
- package/dist/easygov.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ On any other host (localhost, adesso dev cluster review apps, CI), set these
|
|
|
49
49
|
| `NEXT_PUBLIC_CORE_ORIGIN` | Yes | Core frontend base URL, used for dashboard links. |
|
|
50
50
|
| `NEXT_PUBLIC_CORE_API_ORIGIN` | No | Core API base URL. Defaults to `NEXT_PUBLIC_CORE_ORIGIN`; only needed when the API runs on a different origin (e.g. a different port on localhost). |
|
|
51
51
|
| `NEXT_PUBLIC_OIDC_AUTHORITY` | Yes | **Full** Keycloak authority URL including the realm path, e.g. `https://keycloak.example.com/auth/realms/easygov`. |
|
|
52
|
+
| `NEXT_PUBLIC_INFO_ORIGIN` | No | Info module base URL, used as the post-logout redirect target. Only needed on hosts where the `info` subdomain label can't be auto-derived (e.g. the adesso dev cluster, localhost); defaults to the current page URL when unset and undetectable. |
|
|
52
53
|
|
|
53
54
|
If `NEXT_PUBLIC_CORE_ORIGIN` or `NEXT_PUBLIC_OIDC_AUTHORITY` is missing on a
|
|
54
55
|
non-`easygov.swiss` host, the header degrades gracefully (auth disabled, no API
|
package/dist/easygov.d.mts
CHANGED
|
@@ -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 };
|