We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 077644a commit 6404463Copy full SHA for 6404463
src/redux/state/auth/auth-state.ts
@@ -1,5 +1,6 @@
1
import { createSlice, createAsyncThunk, type PayloadAction } from '@reduxjs/toolkit';
2
import * as SecureStore from 'expo-secure-store';
3
+import Api from '@/redux/config/api';
4
import { NullableNumber, NullableString } from '@/types/global-types';
5
import { parseJwt } from '@/utils/jwt-utils';
6
@@ -60,6 +61,7 @@ export const handleAuthSuccess = createAsyncThunk(
60
61
'auth/handleAuthSuccess',
62
async (data: { accessToken: string; refreshToken: string }, { dispatch }) => {
63
await SecureStore.setItemAsync('refreshToken', data.refreshToken);
64
+ dispatch(Api.util.resetApiState());
65
dispatch(setCredentials({ accessToken: data.accessToken }));
66
}
67
);
0 commit comments