bt-core-app 2.0.136 → 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.
- package/dist/bt-core-app.js +13 -8
- package/dist/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/bt-core-app.js
CHANGED
|
@@ -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) {
|
|
@@ -9497,8 +9497,8 @@ function pP(e) {
|
|
|
9497
9497
|
return e.tryRefreshToken ?? (e.tryRefreshToken = async () => {
|
|
9498
9498
|
if (e.useTokenRefresh !== !0 || ia(r.value.refreshToken) || ia(r.value.refreshExpiresOn))
|
|
9499
9499
|
return;
|
|
9500
|
-
const A = it.fromFormat(r.value.refreshExpiresOn, t), L = it.fromFormat(r.value.expiresOn, t), V = it.utc().
|
|
9501
|
-
if (!(V > A.
|
|
9500
|
+
const A = it.fromFormat(r.value.refreshExpiresOn, t), L = it.fromFormat(r.value.expiresOn, t), V = it.utc().toFormat(t), P = L.plus({ minutes: 0 - a });
|
|
9501
|
+
if (!(V > A.toFormat(t)) && !(V < P.toFormat(t))) {
|
|
9502
9502
|
var E = yn(xv(), e.tokenRefreshPath ?? "refreshtoken");
|
|
9503
9503
|
try {
|
|
9504
9504
|
var $ = await fetch(E, {
|
|
@@ -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
|
|
9569
|
-
|
|
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), {
|
|
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