@go-avro/avro-js 0.0.2-beta.81 → 0.0.2-beta.83
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/dist/auth/AuthManager.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StandardError } from '../types/error';
|
|
1
2
|
export class AuthManager {
|
|
2
3
|
constructor({ baseUrl, storage, }) {
|
|
3
4
|
this.tokenRefreshedCallbacks = [];
|
|
@@ -76,7 +77,7 @@ export class AuthManager {
|
|
|
76
77
|
storage.clear();
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
throw new
|
|
80
|
+
throw new StandardError(410, 'Failed to refresh tokens from all storages');
|
|
80
81
|
}
|
|
81
82
|
async accessToken() {
|
|
82
83
|
if (!this.storages.length) {
|
|
@@ -108,7 +109,9 @@ export class AuthManager {
|
|
|
108
109
|
}
|
|
109
110
|
catch (error) {
|
|
110
111
|
this.tokenRefreshFailedCallbacks.forEach(cb => cb());
|
|
111
|
-
|
|
112
|
+
if (error?.status !== 410) {
|
|
113
|
+
console.error('Failed to refresh tokens:', error);
|
|
114
|
+
}
|
|
112
115
|
return null;
|
|
113
116
|
}
|
|
114
117
|
}
|
|
@@ -26,11 +26,11 @@ declare module '../client/QueryClient' {
|
|
|
26
26
|
useGetRoutes(companyGuid: string, body: {
|
|
27
27
|
amt?: number;
|
|
28
28
|
query?: string;
|
|
29
|
-
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<
|
|
29
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Route[], StandardError>;
|
|
30
30
|
useGetTeams(companyGuid: string, body: {
|
|
31
31
|
amt?: number;
|
|
32
32
|
query?: string;
|
|
33
|
-
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<
|
|
33
|
+
}, total: number, onProgress?: (fraction: number) => void): UseQueryResult<Team[], StandardError>;
|
|
34
34
|
useGetEvents(companyGuid: string, body: {
|
|
35
35
|
amt?: number;
|
|
36
36
|
known_ids?: string[];
|