spry-apps-dropdown 3.0.3 → 3.1.0

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.
@@ -13,18 +13,6 @@ export interface LogoutResult {
13
13
  message: string;
14
14
  remainingAccounts: number;
15
15
  }
16
- /**
17
- * Clear Keycloak SSO session via fetch (without redirect)
18
- * Used before signinRedirect to handle SSO collision when adding new account
19
- *
20
- * Important: Soft-logout clears Keycloak SSO cookies without revoking tokens.
21
- * This preserves offline refresh tokens for multi-account switching.
22
- *
23
- * @param user - Current OIDC user with refresh_token
24
- * @param keycloakConfig - Keycloak configuration
25
- * @returns Success boolean
26
- */
27
- export declare function clearSSOSessionBeforeAddAccount(_user: OIDCUser | null, keycloakConfig: KeycloakConfig): Promise<boolean>;
28
16
  /**
29
17
  * Sign out a single account and optionally switch to another
30
18
  * Uses silent token revocation (no redirect) to logout without interrupting the user.
@@ -2,25 +2,22 @@
2
2
  * useAccountManager Hook
3
3
  * Core integration point for multi-account switching with Keycloak
4
4
  *
5
- * Manages account storage, switching, and token refresh
6
- * Handles redirect-based add account flow with state flags
5
+ * Manages account storage, switching, and token refresh.
7
6
  *
8
- * Redirect Flow (5 steps):
9
- * 1. Save state before redirect (current user, flags, return URL)
10
- * 2. Clear SSO session via fetch, then signinRedirect
11
- * 3. Keycloak redirects back, primary auth provider (ReactKeycloak) processes callback
12
- * 4. On mount, detect flag, wait for initialUser, add to accounts, call onAccountSwitch
13
- * 5. Navigate to return URL
7
+ * Add Account Flow:
8
+ * 1. addNewAccount() calls signinRedirect({ prompt: 'select_account' })
9
+ * 2. Keycloak handles soft-logout server-side and shows login/account picker
10
+ * 3. On callback, auth state change is detected and new account is added automatically
14
11
  */
15
12
  import type { UseAccountManagerOptions, UseAccountManagerReturn } from './types';
16
13
  /**
17
- * Hook for managing multi-account switching with redirect-based add account flow
14
+ * Hook for managing multi-account switching
18
15
  *
19
16
  * Usage:
20
17
  * ```
21
18
  * const accountManager = useAccountManager({
22
19
  * keycloakConfig: { authority: '...', client_id: '...', redirect_uri: '...' },
23
- * initialUser: keycloak.user, // From @react-keycloak/web
20
+ * initialUser: keycloak.user,
24
21
  * onAccountSwitch: (user) => updateKeycloakTokens(user.access_token, user.refresh_token)
25
22
  * })
26
23
  * ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spry-apps-dropdown",
3
- "version": "3.0.3",
3
+ "version": "3.1.0",
4
4
  "description": "React components for Spry apps dropdown and profile menu with dynamic API integration - Google-style UI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",