Skip to content

Commit

Permalink
Merge pull request #396 from cultuurnet/bugfix/UIT-240-tracking-issues
Browse files Browse the repository at this point in the history
UIT-240: tracking issues
  • Loading branch information
hstandaert authored Feb 12, 2024
2 parents cac4d15 + 80c0080 commit 9517911
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions src/_context/AuthenticationContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ const AuthenticationProvider: FC<PropsWithChildren> = ({ children }) => {
const [isInitialized, setIsInitialized] = useToggle(false);
const [isAuthenticated, setIsAuthenticated] = useToggle(false);

useEffect(() => {
if (!isAuthenticated) {
const queryCache = new QueryCache({});
queryClient.clear();
queryCache.clear();
queryClient.removeQueries();
}
}, [isAuthenticated]);

const client = useMemo(
() =>
new Auth0({
Expand All @@ -56,6 +47,16 @@ const AuthenticationProvider: FC<PropsWithChildren> = ({ children }) => {
const logout = useCallback(async () => {
try {
await client.credentialsManager.clearCredentials();

// Clear react query cache
const queryCache = new QueryCache({});
queryClient.clear();
queryCache.clear();
queryClient.removeQueries();

// Reset state
setAccessToken(undefined);
setUser(undefined);
setIsAuthenticated(false);
} catch (e) {
log.error(e);
Expand Down
2 changes: 1 addition & 1 deletion src/scan/familyCheckin/FamilyCheckin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const FamilyCheckin: FC = ({ navigation, route }: TProps) => {
{
up_action: {
...sharedAction,
points: null,
points: 0,
},
},
);
Expand Down

0 comments on commit 9517911

Please sign in to comment.