@iblai/web-utils 1.6.1 → 1.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/web-utils",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/web-utils",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",