@autobusal/providers 1.0.58 → 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.
@@ -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
- alert(401);
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
@@ -40,8 +43,6 @@ apiClient.interceptors.response.use(response => (
40
43
 
41
44
  systemError(languages[language as keyof typeof languages].server);
42
45
  }
43
-
44
-
45
46
  } else if (error.request) {
46
47
  alert('NO REQUEST!!!');
47
48
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "type": "module",
5
5
  "main": "index.ts"
6
6
  }
package/types/users.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export interface UserData {
2
2
  id: number
3
3
  name: string
4
- type: 'operator'
4
+ type: 'operator' | 'financer'
5
5
  verified: Date
6
6
  status: number
7
7
  funds: string