@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.js CHANGED
@@ -2874,8 +2874,9 @@ async function isDmTokenExpired(storageService) {
2874
2874
  * @returns boolean indicating if token is valid for current user
2875
2875
  */
2876
2876
  async function validateJwtToken(storageService) {
2877
+ let edxJwtToken;
2877
2878
  try {
2878
- const edxJwtToken = await storageService.getItem(LOCAL_STORAGE_KEYS.EDX_TOKEN_KEY);
2879
+ edxJwtToken = await storageService.getItem(LOCAL_STORAGE_KEYS.EDX_TOKEN_KEY);
2879
2880
  console.log("[AuthProvider] JWT token ", edxJwtToken);
2880
2881
  const userData = await storageService.getItem(LOCAL_STORAGE_KEYS.USER_DATA);
2881
2882
  if (!edxJwtToken || !userData) {
@@ -2892,7 +2893,7 @@ async function validateJwtToken(storageService) {
2892
2893
  return true;
2893
2894
  }
2894
2895
  catch (error) {
2895
- console.error("[AuthProvider] Error validating JWT token:", error);
2896
+ console.error("[AuthProvider] Error validating JWT token:", error, "Token is ", edxJwtToken);
2896
2897
  return false;
2897
2898
  }
2898
2899
  }
@@ -3094,7 +3095,9 @@ function useAuthProvider({ middleware = new Map(), onAuthSuccess, onAuthFailure,
3094
3095
  const dmTokenInLocalStorage = await storageService.getItem(LOCAL_STORAGE_KEYS.DM_TOKEN_KEY);
3095
3096
  console.log("[auth-redirect] local storage keys ", LOCAL_STORAGE_KEYS);
3096
3097
  console.log("[auth-redirect] local storage ", JSON.stringify(localStorage));
3098
+ console.log("[auth-redirect] dmTokenInLocalStorage ", dmTokenInLocalStorage);
3097
3099
  const dmTokenExpired = await isDmTokenExpired(storageService);
3100
+ console.log("[auth-redirect] dmTokenExpired ", dmTokenExpired);
3098
3101
  if (!dmTokenInLocalStorage || dmTokenExpired) {
3099
3102
  if (!!dmTokenInLocalStorage) {
3100
3103
  console.log("[auth-redirect] DM token doesn't exists");