bt-core-app 2.0.137 → 2.0.138

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.
@@ -9465,7 +9465,7 @@ function pP(e) {
9465
9465
  function v(A) {
9466
9466
  return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (L, V) => {
9467
9467
  const P = yn(xv(), `authorize?response_type=code&client_id=${e.oauthClientID}&redirect_uri=${window.location.origin}/authentication&state=${V}`);
9468
- return L ? `${P}&redirect_path=${L}` : P;
9468
+ return console.log("redirect: " + L), L != null ? `${P}&redirect_path=${L}` : P;
9469
9469
  }), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(A, n.value) ?? "" : "";
9470
9470
  }
9471
9471
  function f(A) {
@@ -9564,9 +9564,14 @@ function pP(e) {
9564
9564
  var A;
9565
9565
  r.value ?? (r.value = {}), (A = r.value).timeZone ?? (A.timeZone = e.defaultTimeZone ?? Wp);
9566
9566
  }
9567
- function C() {
9568
- const A = vt(r);
9569
- return A.isLoggedIn && D() && _() && (m(), window.location.href = v()), A.isLoggedIn;
9567
+ function C(A, L) {
9568
+ const V = vt(r);
9569
+ if (V.isLoggedIn && D() && _()) {
9570
+ m();
9571
+ let P = v(A);
9572
+ L != null && (P.includes("?") || (P = P + "?"), P.includes("&") && (P = P + "&"), P = P + new URLSearchParams(L).toString()), window.location.href = P;
9573
+ }
9574
+ return V.isLoggedIn;
9570
9575
  }
9571
9576
  function _() {
9572
9577
  if (!e.useTokenRefresh || ia(r.value.refreshExpiresOn) || ia(r.value.refreshToken))
@@ -14043,7 +14048,7 @@ function rse(e, t, a, n) {
14043
14048
  if (e.query.isDemo === "true" && !i.isDemoing.value && i.startDemo(), d(), s)
14044
14049
  if (i.isDemoing.value)
14045
14050
  l.updateNavigationChange(e, t);
14046
- else if (r.tryLogin()) {
14051
+ else if (r.tryLogin(window.location.pathname)) {
14047
14052
  const f = (o == null ? void 0 : o.subscriptions) ?? [], g = (o == null ? void 0 : o.permissions) ?? [];
14048
14053
  if (f.push(...u), g.push(...c), r.doShow(f, g, "view")) {
14049
14054
  l.updateNavigationChange(e, t);
@@ -14051,7 +14056,7 @@ function rse(e, t, a, n) {
14051
14056
  } else
14052
14057
  return { name: a };
14053
14058
  } else
14054
- return r.login(window.location.pathname), { name: a };
14059
+ return r.login(window.location.pathname), { path: "/" };
14055
14060
  else if (l.updateNavigationChange(e, t), e.path == "/" && r.tryLogin() && ia((v = t.name) == null ? void 0 : v.toString()))
14056
14061
  return { name: n };
14057
14062
  }
package/dist/index.d.ts CHANGED
@@ -260,7 +260,7 @@ export declare interface BTAuth {
260
260
  testToken: () => Promise<boolean>;
261
261
  timeZone: ComputedRef<string>;
262
262
  tokenExpired: () => boolean;
263
- tryLogin: () => boolean | undefined;
263
+ tryLogin: (redirectPath?: string, query?: any) => boolean | undefined;
264
264
  tryRefreshToken: () => Promise<void>;
265
265
  }
266
266
 
@@ -992,6 +992,10 @@ export declare interface GroupedHeaderOption {
992
992
 
993
993
  export declare function guardRoute(to: RouteLocationNormalized, from: RouteLocationNormalized, restrictedName: string, loggedInHome: string): {
994
994
  name: string;
995
+ path?: undefined;
996
+ } | {
997
+ path: string;
998
+ name?: undefined;
995
999
  } | undefined;
996
1000
 
997
1001
  /**tests for whether string is contains in any of the given props of the given value */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "2.0.137",
3
+ "version": "2.0.138",
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": {