Skip to content

Commit 6404463

Browse files
committed
Reseting cache on login
1 parent 077644a commit 6404463

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/redux/state/auth/auth-state.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createSlice, createAsyncThunk, type PayloadAction } from '@reduxjs/toolkit';
22
import * as SecureStore from 'expo-secure-store';
3+
import Api from '@/redux/config/api';
34
import { NullableNumber, NullableString } from '@/types/global-types';
45
import { parseJwt } from '@/utils/jwt-utils';
56

@@ -60,6 +61,7 @@ export const handleAuthSuccess = createAsyncThunk(
6061
'auth/handleAuthSuccess',
6162
async (data: { accessToken: string; refreshToken: string }, { dispatch }) => {
6263
await SecureStore.setItemAsync('refreshToken', data.refreshToken);
64+
dispatch(Api.util.resetApiState());
6365
dispatch(setCredentials({ accessToken: data.accessToken }));
6466
}
6567
);

0 commit comments

Comments
 (0)