@0xchain/request 1.1.0-beta.65 → 1.1.0-beta.66
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/index.js +2 -1
- package/dist/tokenRefresh.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios, { isAxiosError, AxiosError } from "axios";
|
|
2
2
|
import qs from "qs";
|
|
3
3
|
import jsCookie from "js-cookie";
|
|
4
|
-
import { envCookieName, getToken, isTokenExpired } from "@0xchain/token";
|
|
4
|
+
import { envCookieName, getToken, removeAllToken, isTokenExpired } from "@0xchain/token";
|
|
5
5
|
import { logger } from "@0xchain/logger";
|
|
6
6
|
const isSimplifiedChinese = () => {
|
|
7
7
|
return /^(zh-hans|zh-cn|zh-sg|zh-my)$/.test(window?.navigator.language.toLowerCase());
|
|
@@ -230,6 +230,7 @@ function refreshAccessToken() {
|
|
|
230
230
|
if (data?.access_token) {
|
|
231
231
|
return data.access_token;
|
|
232
232
|
}
|
|
233
|
+
removeAllToken();
|
|
233
234
|
return null;
|
|
234
235
|
}).catch(() => null).then((result) => {
|
|
235
236
|
lastRefreshAt = Date.now();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenRefresh.d.ts","sourceRoot":"","sources":["../src/tokenRefresh.ts"],"names":[],"mappings":"AAqCA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"tokenRefresh.d.ts","sourceRoot":"","sources":["../src/tokenRefresh.ts"],"names":[],"mappings":"AAqCA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiD3D;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xchain/request",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.66",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"qs": "6.14.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@0xchain/token": "1.1.0-beta.
|
|
36
|
-
"@0xchain/logger": "1.1.0-beta.
|
|
35
|
+
"@0xchain/token": "1.1.0-beta.66",
|
|
36
|
+
"@0xchain/logger": "1.1.0-beta.66"
|
|
37
37
|
},
|
|
38
38
|
"nx": {
|
|
39
39
|
"tags": [
|