(err: ApiErrorResult)
| 275 | // subscribe to auth errors of queries and mutations and in case token |
| 276 | // expired at the time of error refetch boot to get the new one |
| 277 | const onAuthError = (err: ApiErrorResult) => { |
| 278 | if ( |
| 279 | !getApiError(err, ApiError.Forbidden) && |
| 280 | !getApiError(err, ApiError.Unauthenticated) |
| 281 | ) { |
| 282 | return; |
| 283 | } |
| 284 | |
| 285 | const expiresIn = remoteData?.accessToken?.expiresIn; |
| 286 | |
| 287 | if (expiresIn && new Date(expiresIn) < new Date()) { |
| 288 | debouncedRefetch(); |
| 289 | } |
| 290 | }; |
| 291 | |
| 292 | const unsubscribeQueries = queryClient |
| 293 | .getQueryCache() |
no test coverage detected