From c088efb2e3088adeef7e8037714f8ff2f91b326c Mon Sep 17 00:00:00 2001 From: panagiotis vourtsis Date: Mon, 21 Aug 2023 15:40:59 +0300 Subject: [PATCH] fix: adding exlicit cachelocation for bypassing adblockers --- __mocks__/@auth0/auth0-spa-js.ts | 1 + src/authentication/context.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/__mocks__/@auth0/auth0-spa-js.ts b/__mocks__/@auth0/auth0-spa-js.ts index 0757d4cc..9e0fddda 100644 --- a/__mocks__/@auth0/auth0-spa-js.ts +++ b/__mocks__/@auth0/auth0-spa-js.ts @@ -86,6 +86,7 @@ export const createAuth0 = jest.fn().mockImplementation((options: any) => organization: undefined, }, useRefreshTokensFallback: true, + useRefreshTokens: true, }) ); diff --git a/src/authentication/context.tsx b/src/authentication/context.tsx index 06b7ec56..6696cbd2 100644 --- a/src/authentication/context.tsx +++ b/src/authentication/context.tsx @@ -1,11 +1,11 @@ import createAuth0Client, { + Auth0Client, + Auth0ClientOptions, GetTokenSilentlyOptions, RedirectLoginOptions, - Auth0ClientOptions, - Auth0Client, } from '@auth0/auth0-spa-js'; import jwt_decode from 'jwt-decode'; -import React, { useState, useEffect, createContext } from 'react'; +import React, { createContext, useEffect, useState } from 'react'; import { useErrorHandler } from 'react-error-boundary'; import useOrganization from '../store/useOrganization'; @@ -28,6 +28,7 @@ const providerConfig: Auth0ClientOptions = { redirect_uri: window.location.origin, onRedirectCallback, useRefreshTokens: true, + cacheLocation: 'localstorage', }; export const defaultContextValues: AuthenticationContextProps = {