@iblai/web-utils 1.6.0 → 1.6.2
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/data-layer/src/features/claw/api-slice.d.ts +5471 -0
- package/dist/data-layer/src/features/claw/constants.d.ts +126 -0
- package/dist/data-layer/src/features/claw/types.d.ts +275 -0
- package/dist/data-layer/src/index.d.ts +3 -0
- package/dist/index.d.ts +22 -4
- package/dist/index.esm.js +645 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +645 -8
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/web-utils/src/providers/auth-provider.d.ts +1 -1
- package/dist/web-utils/src/utils/auth.d.ts +18 -0
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -125,5 +125,5 @@ type Props = {
|
|
|
125
125
|
* 4. Handles redirects to auth SPA when needed
|
|
126
126
|
* 5. Manages public route access state
|
|
127
127
|
*/
|
|
128
|
-
export declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname,
|
|
128
|
+
export declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, token, enableStorageSync, skip, }: Props): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
129
129
|
export {};
|
|
@@ -52,6 +52,12 @@ export declare function setCookieForAuth(name: string, value: string, days?: num
|
|
|
52
52
|
* Clear all cookies for the current domain
|
|
53
53
|
*/
|
|
54
54
|
export declare function clearCookies(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Get the value of a cookie by name
|
|
57
|
+
* @param name - Cookie name
|
|
58
|
+
* @returns The cookie value or null if not found
|
|
59
|
+
*/
|
|
60
|
+
export declare function getCookieValue(name: string): string | null;
|
|
55
61
|
/**
|
|
56
62
|
* Check if user is currently logged in
|
|
57
63
|
* @param tokenKey - The localStorage key for the auth token (default: 'axd_token')
|
|
@@ -92,7 +98,19 @@ export interface RedirectToAuthSpaOptions {
|
|
|
92
98
|
userData?: string;
|
|
93
99
|
tenant?: string;
|
|
94
100
|
logoutTimestamp?: string;
|
|
101
|
+
loginTimestamp?: string;
|
|
102
|
+
tenantSwitching?: string;
|
|
95
103
|
};
|
|
104
|
+
/** Function to check if auth token is valid and non-expired. Used to skip redirect when a recent login occurred. */
|
|
105
|
+
hasNonExpiredAuthToken?: () => boolean;
|
|
106
|
+
/** Function to check if the app is in offline mode (e.g., Tauri offline). Skips redirect when true. */
|
|
107
|
+
isOffline?: () => boolean;
|
|
108
|
+
/** localStorage key for a token to preserve before clearing storage (e.g., 'edx_jwt_token') */
|
|
109
|
+
preserveTokenKey?: string;
|
|
110
|
+
/** Path to an auth redirect proxy endpoint (e.g., '/api/auth-redirect'). When set, redirects via this proxy in browser. */
|
|
111
|
+
authRedirectProxy?: string;
|
|
112
|
+
/** Function to check if the app is running as a native app (e.g., Tauri). Affects redirect behavior. */
|
|
113
|
+
isNativeApp?: () => boolean;
|
|
96
114
|
}
|
|
97
115
|
/**
|
|
98
116
|
* Redirect to authentication SPA for login/logout
|