@autobusal/providers 1.0.57 → 1.0.59
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/Queries/apiClient.ts +7 -2
- package/package.json +1 -1
- package/services.ts +0 -2
- package/types/users.ts +1 -1
package/Queries/apiClient.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { error as systemError } from '@autobusal/utilities';
|
|
|
5
5
|
|
|
6
6
|
const apiClient = axios.create({
|
|
7
7
|
baseURL: import.meta.env.VITE_API_OBT,
|
|
8
|
-
withCredentials: true
|
|
8
|
+
withCredentials: true,
|
|
9
|
+
withXSRFToken: true
|
|
9
10
|
});
|
|
10
11
|
|
|
11
12
|
apiClient.interceptors.request.use(
|
|
@@ -26,7 +27,9 @@ apiClient.interceptors.response.use(response => (
|
|
|
26
27
|
if (error.response) {
|
|
27
28
|
// if we have a 401, we go to the logout page
|
|
28
29
|
if (error.response.status === 401) {
|
|
29
|
-
|
|
30
|
+
// if (!window.location.hash) {
|
|
31
|
+
// window.location.href = '/account/logout#redirect';
|
|
32
|
+
// }
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
// if we have a 422 error, we display the message
|
|
@@ -45,6 +48,8 @@ apiClient.interceptors.response.use(response => (
|
|
|
45
48
|
} else {
|
|
46
49
|
alert('OPAOPA!');
|
|
47
50
|
}
|
|
51
|
+
|
|
52
|
+
return Promise.reject(error);
|
|
48
53
|
});
|
|
49
54
|
|
|
50
55
|
export default apiClient;
|
package/package.json
CHANGED
package/services.ts
CHANGED
|
@@ -12,7 +12,6 @@ export const GetSettings = (): UseSuspenseQueryResult<SettingsData> => (
|
|
|
12
12
|
.then(response => (
|
|
13
13
|
response.data
|
|
14
14
|
))
|
|
15
|
-
.catch(() => {})
|
|
16
15
|
),
|
|
17
16
|
staleTime: Infinity
|
|
18
17
|
})
|
|
@@ -31,7 +30,6 @@ export const GetMenu = (): UseSuspenseQueryResult<MenuData> => {
|
|
|
31
30
|
|
|
32
31
|
return {};
|
|
33
32
|
})
|
|
34
|
-
.catch(() => {})
|
|
35
33
|
)
|
|
36
34
|
})
|
|
37
35
|
};
|