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.
- package/dist/accountStorage.d.ts +4 -34
- package/dist/constants.d.ts +0 -4
- package/dist/index.cjs +16 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2319 -2310
- package/dist/index.js.map +1 -1
- package/dist/keycloakLogout.d.ts +0 -12
- package/dist/useAccountManager.d.ts +7 -10
- package/package.json +1 -1
package/dist/keycloakLogout.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
9
|
-
* 1.
|
|
10
|
-
* 2.
|
|
11
|
-
* 3.
|
|
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
|
|
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,
|
|
20
|
+
* initialUser: keycloak.user,
|
|
24
21
|
* onAccountSwitch: (user) => updateKeycloakTokens(user.access_token, user.refresh_token)
|
|
25
22
|
* })
|
|
26
23
|
* ```
|
package/package.json
CHANGED