@iblai/web-utils 1.6.3 → 1.6.5
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/index.d.ts +3 -3
- package/dist/index.esm.js +5 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1575,7 +1575,7 @@ type Props$2 = {
|
|
|
1575
1575
|
* 4. Handles redirects to auth SPA when needed
|
|
1576
1576
|
* 5. Manages public route access state
|
|
1577
1577
|
*/
|
|
1578
|
-
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean |
|
|
1578
|
+
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, token, enableStorageSync, skip, }: Props$2): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
1579
1579
|
|
|
1580
1580
|
/**
|
|
1581
1581
|
* Props for the MentorProvider component
|
|
@@ -1608,7 +1608,7 @@ type Props$1 = {
|
|
|
1608
1608
|
* 3. Manages redirection based on mentor availability
|
|
1609
1609
|
* 4. Integrates with tenant context for access control
|
|
1610
1610
|
*/
|
|
1611
|
-
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean |
|
|
1611
|
+
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, onComplete, skip, }: Props$1): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
1612
1612
|
|
|
1613
1613
|
/**
|
|
1614
1614
|
* Type definition for the tenant context
|
|
@@ -1672,7 +1672,7 @@ type Props = {
|
|
|
1672
1672
|
* 4. Handles tenant-specific domain redirects
|
|
1673
1673
|
* 5. Maintains tenant access state
|
|
1674
1674
|
*/
|
|
1675
|
-
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, onTenantMismatch, }: Props): string | number | bigint | boolean |
|
|
1675
|
+
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, redirectToAuthSpa, username, isIframed, setUseMentorProvider, skip, onLoadPlatformPermissions, skipCustomDomainCheck, onTenantMismatch, }: Props): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
1676
1676
|
|
|
1677
1677
|
/**
|
|
1678
1678
|
* Chat area size constants
|
package/dist/index.esm.js
CHANGED
|
@@ -2854,8 +2854,9 @@ async function isDmTokenExpired(storageService) {
|
|
|
2854
2854
|
* @returns boolean indicating if token is valid for current user
|
|
2855
2855
|
*/
|
|
2856
2856
|
async function validateJwtToken(storageService) {
|
|
2857
|
+
let edxJwtToken;
|
|
2857
2858
|
try {
|
|
2858
|
-
|
|
2859
|
+
edxJwtToken = await storageService.getItem(LOCAL_STORAGE_KEYS.EDX_TOKEN_KEY);
|
|
2859
2860
|
console.log("[AuthProvider] JWT token ", edxJwtToken);
|
|
2860
2861
|
const userData = await storageService.getItem(LOCAL_STORAGE_KEYS.USER_DATA);
|
|
2861
2862
|
if (!edxJwtToken || !userData) {
|
|
@@ -2872,7 +2873,7 @@ async function validateJwtToken(storageService) {
|
|
|
2872
2873
|
return true;
|
|
2873
2874
|
}
|
|
2874
2875
|
catch (error) {
|
|
2875
|
-
console.error("[AuthProvider] Error validating JWT token:", error);
|
|
2876
|
+
console.error("[AuthProvider] Error validating JWT token:", error, "Token is ", edxJwtToken);
|
|
2876
2877
|
return false;
|
|
2877
2878
|
}
|
|
2878
2879
|
}
|
|
@@ -3074,7 +3075,9 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
|
|
|
3074
3075
|
const dmTokenInLocalStorage = await storageService.getItem(LOCAL_STORAGE_KEYS.DM_TOKEN_KEY);
|
|
3075
3076
|
console.log("[auth-redirect] local storage keys ", LOCAL_STORAGE_KEYS);
|
|
3076
3077
|
console.log("[auth-redirect] local storage ", JSON.stringify(localStorage));
|
|
3078
|
+
console.log("[auth-redirect] dmTokenInLocalStorage ", dmTokenInLocalStorage);
|
|
3077
3079
|
const dmTokenExpired = await isDmTokenExpired(storageService);
|
|
3080
|
+
console.log("[auth-redirect] dmTokenExpired ", dmTokenExpired);
|
|
3078
3081
|
if (!dmTokenInLocalStorage || dmTokenExpired) {
|
|
3079
3082
|
if (!!dmTokenInLocalStorage) {
|
|
3080
3083
|
console.log("[auth-redirect] DM token doesn't exists");
|