sprof 1.13.0 → 1.14.0
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.
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
import { NavigationGuardNext } from 'vue-router';
|
|
1
|
+
import { NavigationGuard, NavigationGuardNext } from 'vue-router';
|
|
2
|
+
/**
|
|
3
|
+
* Минимальный контракт Keycloak-хелпера клиента (`src/helpers/auth`).
|
|
4
|
+
* Структурный тип — чтобы библиотека не зависела от конкретной реализации.
|
|
5
|
+
*/
|
|
6
|
+
export interface KeycloakAuth {
|
|
7
|
+
isReady: () => boolean;
|
|
8
|
+
init: () => Promise<unknown>;
|
|
9
|
+
isAuth: () => boolean;
|
|
10
|
+
login: (redirectUri: string) => Promise<unknown>;
|
|
11
|
+
}
|
|
2
12
|
export default abstract class RouterGuard {
|
|
3
|
-
|
|
4
|
-
static
|
|
13
|
+
/** Пропускающий guard: актуализирует статус и передаёт навигацию дальше. */
|
|
14
|
+
static Auth(next?: NavigationGuardNext): void;
|
|
15
|
+
/**
|
|
16
|
+
* Реальный Keycloak-guard: неавторизованного уводит на форму входа,
|
|
17
|
+
* запоминая исходный маршрут в `sessionStorage.auth_redirect`.
|
|
18
|
+
* Регистрируется в `router/index.ts` через `beforeEach`.
|
|
19
|
+
*/
|
|
20
|
+
static Keycloak(auth: KeycloakAuth): NavigationGuard;
|
|
5
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/sprof.js
CHANGED
|
@@ -5569,10 +5569,17 @@ class Am {
|
|
|
5569
5569
|
}
|
|
5570
5570
|
}
|
|
5571
5571
|
class Em {
|
|
5572
|
-
|
|
5573
|
-
|
|
5572
|
+
/** Пропускающий guard: актуализирует статус и передаёт навигацию дальше. */
|
|
5573
|
+
static Auth(e) {
|
|
5574
|
+
Y.Auth.Status.Actualize(), e && e();
|
|
5574
5575
|
}
|
|
5575
|
-
|
|
5576
|
+
/**
|
|
5577
|
+
* Реальный Keycloak-guard: неавторизованного уводит на форму входа,
|
|
5578
|
+
* запоминая исходный маршрут в `sessionStorage.auth_redirect`.
|
|
5579
|
+
* Регистрируется в `router/index.ts` через `beforeEach`.
|
|
5580
|
+
*/
|
|
5581
|
+
static Keycloak(e) {
|
|
5582
|
+
return async (n) => (Y.Auth.Status.Actualize(), e.isReady() || await e.init(), e.isAuth() ? !0 : (sessionStorage.setItem("auth_redirect", n.fullPath), await e.login(window.location.origin + n.fullPath), !1));
|
|
5576
5583
|
}
|
|
5577
5584
|
}
|
|
5578
5585
|
class Fm {
|
package/package.json
CHANGED