bt-core-app 1.4.569 → 1.4.571

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/bt-core-app.js +13 -12
  2. package/package.json +1 -1
@@ -8863,24 +8863,25 @@ function Mx(e) {
8863
8863
  }
8864
8864
  async function d() {
8865
8865
  return e.tryRefreshToken ?? (e.tryRefreshToken = async () => {
8866
- if (console.log("trying refresh"), e.useTokenRefresh === !0) {
8867
- if (!Gn(r.value.refreshToken) && !Gn(r.value.refreshExpiresOn)) {
8868
- const M = Oe.fromFormat(r.value.refreshExpiresOn, t), E = Oe.utc(), P = M.plus({ hours: 0 - n });
8869
- if (console.log(`testing ${M} with ${E} and if after ${P}`), E < M || E < P)
8870
- return;
8871
- }
8872
- var D = Qt($o(), e.tokenRefreshPath ?? "refreshtoken");
8873
- console.log(`refresh url: ${D}`);
8866
+ if (console.log("trying refresh"), e.useTokenRefresh !== !0 || Gn(r.value.refreshToken) || Gn(r.value.refreshExpiresOn))
8867
+ return;
8868
+ const D = Oe.fromFormat(r.value.refreshExpiresOn, t), V = Oe.utc(), I = D.plus({ hours: 0 - n });
8869
+ if (console.log(`testing ${D} with ${V} and if after ${I}`), !(V < D) && !(V < I)) {
8870
+ var M = Qt($o(), e.tokenRefreshPath ?? "refreshtoken");
8871
+ console.log(`refresh url: ${M}`);
8874
8872
  try {
8875
- var V = await fetch(D, {
8873
+ var E = await fetch(M, {
8876
8874
  method: "POST",
8877
8875
  mode: "cors",
8878
8876
  cache: "no-cache",
8877
+ headers: {
8878
+ "Content-Type": "application/json"
8879
+ },
8879
8880
  body: JSON.stringify({ refreshToken: r.value.refreshToken })
8880
8881
  });
8881
- if (V.ok) {
8882
- var I = await V.json();
8883
- V != null && I.data != null && w(I.data);
8882
+ if (E.ok) {
8883
+ var P = await E.json();
8884
+ E != null && P.data != null && w(P.data);
8884
8885
  }
8885
8886
  } catch {
8886
8887
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "1.4.569",
3
+ "version": "1.4.571",
4
4
  "description": "Core app tools for some basic features like navigation, authentication, server apis, and cosmetics",
5
5
  "homepage": "https://github.com/BlitzItTech/bt-core",
6
6
  "bugs": {