@arcblock/did-connect-react 3.2.8 → 3.2.10

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.
@@ -3,13 +3,13 @@ import y from "lodash/pick";
3
3
  import { Confirm as F } from "@arcblock/ux/lib/Dialog";
4
4
  import { Box as h } from "@mui/material";
5
5
  import f from "@arcblock/ux/lib/Toast";
6
- import C from "@arcblock/ux/lib/CardSelector";
7
- import { translate as R } from "@arcblock/ux/lib/Locale/util";
8
- import { useMemoizedFn as T, useCreation as k } from "ahooks";
6
+ import T from "@arcblock/ux/lib/CardSelector";
7
+ import { translate as k } from "@arcblock/ux/lib/Locale/util";
8
+ import { useMemoizedFn as C, useCreation as R } from "ahooks";
9
9
  import { createPassportSvg as I } from "@arcblock/ux/lib/Util/passport";
10
10
  import { ReactGA as P } from "@arcblock/ux/lib/withTracker";
11
11
  import x from "../OAuth/guest.svg.js";
12
- const B = (e) => e ? typeof e == "string" ? { sessionToken: e } : y(e, ["sessionToken", "refreshToken", "visitorId", "destroySessionId"]) : {}, G = {
12
+ const B = (e) => e ? typeof e == "string" ? { sessionToken: e } : y(e, ["sessionToken", "refreshToken", "visitorId", "destroySessionId", "csrfToken"]) : {}, G = {
13
13
  zh: {
14
14
  switchPassport: "切换通行证",
15
15
  switchPassportFailed: "切换通行证失败",
@@ -34,7 +34,7 @@ const B = (e) => e ? typeof e == "string" ? { sessionToken: e } : y(e, ["session
34
34
  }
35
35
  };
36
36
  function q({ api: e, locale: w, switchState: r, onSwitchPassport: g, session: a }) {
37
- const t = T((s, i = {}) => R(G, s, w, "en", i)), l = k(() => r.passports.filter((s) => s.role !== r.currentUser?.role), [r.passports, r.currentUser?.role]), S = async () => {
37
+ const t = C((s, i = {}) => k(G, s, w, "en", i)), l = R(() => r.passports.filter((s) => s.role !== r.currentUser?.role), [r.passports, r.currentUser?.role]), S = async () => {
38
38
  const s = r.selectedPassport, i = a?.user?.role, v = a?.user?.passports?.find((o) => o.id === s)?.role ?? "guest", d = `${i} -> ${v}`;
39
39
  try {
40
40
  const { data: o } = await e.post("/switch", { passportId: s }), { sessionToken: c, refreshToken: n } = B(o);
@@ -90,7 +90,7 @@ function q({ api: e, locale: w, switchState: r, onSwitchPassport: g, session: a
90
90
  }
91
91
  ),
92
92
  /* @__PURE__ */ p(
93
- C,
93
+ T,
94
94
  {
95
95
  width: 160,
96
96
  height: 240,
@@ -1,4 +1,4 @@
1
- const o = "3.2.8", s = {
1
+ const o = "3.2.10", s = {
2
2
  version: o
3
3
  };
4
4
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/did-connect-react",
3
- "version": "3.2.8",
3
+ "version": "3.2.10",
4
4
  "description": "Client side library to work with DID Connect by ArcBlock.",
5
5
  "keywords": [
6
6
  "react",
@@ -32,10 +32,10 @@
32
32
  "url": "https://github.com/ArcBlock/ux/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@arcblock/bridge": "3.2.8",
35
+ "@arcblock/bridge": "3.2.10",
36
36
  "@arcblock/did": "^1.27.6",
37
- "@arcblock/icons": "3.2.8",
38
- "@arcblock/react-hooks": "3.2.8",
37
+ "@arcblock/icons": "3.2.10",
38
+ "@arcblock/react-hooks": "3.2.10",
39
39
  "@arcblock/ws": "^1.27.6",
40
40
  "@fontsource/lexend": "^5.2.9",
41
41
  "@iconify-icons/logos": "^1.2.36",
@@ -80,5 +80,5 @@
80
80
  "eslint-plugin-react-hooks": "^4.6.2",
81
81
  "jest": "^29.7.0"
82
82
  },
83
- "gitHead": "c3986ded30e94992b83a628e4ffc73c99e630b5d"
83
+ "gitHead": "8ed4de885ae6ce687de01add02b489c178da0c12"
84
84
  }
@@ -23,7 +23,7 @@ export const parseResponse = (data) => {
23
23
  return { sessionToken: data };
24
24
  }
25
25
 
26
- return pick(data, ['sessionToken', 'refreshToken', 'visitorId', 'destroySessionId']);
26
+ return pick(data, ['sessionToken', 'refreshToken', 'visitorId', 'destroySessionId', 'csrfToken']);
27
27
  };
28
28
 
29
29
  const translations = {