@ichaingo/auth 1.3.75 → 1.3.77

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.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -21
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1,29 +1,24 @@
1
- import n from "@ichaingo/request";
2
- import { default as m } from "./loginApi.mjs";
3
- import { removeAllToken as i } from "@ichaingo/token";
4
- import { default as s } from "@ichaingo/token";
5
- function c() {
6
- n.get("/connect/logout").then((e) => {
7
- var o;
8
- if (((o = e == null ? void 0 : e.status) == null ? void 0 : o.code) === 0) {
9
- i();
10
- const t = document.createElement("iframe");
11
- t.src = `${process.env.NEXT_PUBLIC_AUTH_URL}/en/logout`, window.addEventListener("message", (a) => {
12
- a.data.type === "logout" && (t.remove(), window.location.pathname.includes("/user-center") ? window.location.replace(process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL || "/") : window.location.reload());
13
- }), t.style.display = "none", document.body.appendChild(t);
14
- }
15
- });
1
+ import t from "@ichaingo/request";
2
+ import { default as s } from "./loginApi.mjs";
3
+ import { removeAllToken as n } from "@ichaingo/token";
4
+ import { default as u } from "@ichaingo/token";
5
+ function i() {
6
+ n();
7
+ const e = document.createElement("iframe");
8
+ e.src = `${process.env.NEXT_PUBLIC_AUTH_URL}/en/logout`, window.addEventListener("message", (o) => {
9
+ o.data.type === "logout" && (e.remove(), window.location.pathname.includes("/user-center") ? window.location.replace(process.env.NEXT_PUBLIC_ICHAINGO_SEARCH_BASEURL || "/") : window.location.reload());
10
+ }), e.style.display = "none", document.body.appendChild(e);
16
11
  }
17
- function d() {
18
- return n.get("/v2/users/profile").then((e) => {
12
+ function l() {
13
+ return t.get("/v2/users/profile").then((e) => {
19
14
  var o;
20
15
  if (((o = e == null ? void 0 : e.status) == null ? void 0 : o.code) === 0)
21
16
  return e.data;
22
17
  });
23
18
  }
24
19
  export {
25
- m as LoginApi,
26
- s as TokenManager,
27
- d as fetchUserProfile,
28
- c as logout
20
+ s as LoginApi,
21
+ u as TokenManager,
22
+ l as fetchUserProfile,
23
+ i as logout
29
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/auth",
3
- "version": "1.3.75",
3
+ "version": "1.3.77",
4
4
  "type": "module",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -24,8 +24,8 @@
24
24
  ],
25
25
  "peerDependencies": {
26
26
  "js-cookie": "3.0.5",
27
- "@ichaingo/request": "1.3.75",
28
- "@ichaingo/token": "1.3.75"
27
+ "@ichaingo/request": "1.3.77",
28
+ "@ichaingo/token": "1.3.77"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/js-cookie": "^3.0.6",