@alfabit/keycloak 0.0.39 → 0.0.41

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alfabit/keycloak",
3
3
  "private": false,
4
- "version": "0.0.39",
4
+ "version": "0.0.41",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
7
  "main": "src/index.ts",
@@ -364,18 +364,17 @@ export async function initKeycloak() {
364
364
 
365
365
 
366
366
 
367
- keycloak.value && (keycloak.value.onAuthLogout = () => {
368
- console.warn('>>>>>>>> Сессия истекла');
369
- // например, показать уведомление
370
- // или открыть собственное модальное окно логина
371
- });
367
+ // keycloak.value && (keycloak.value.onAuthLogout = () => {
368
+ // console.warn('>>>>>>>> Сессия истекла');
369
+ // // например, показать уведомление
370
+ // // или открыть собственное модальное окно логина
371
+ // });
372
372
 
373
373
 
374
374
 
375
375
 
376
376
  const isNeedAuth = !!getToken() && !isRtExp();
377
377
 
378
- // window.opener - если находимся в popup (но не в passport), то 100% уже авторизованы и можно поставить login-required
379
378
  const initOptions: KeycloakInitOptions = {
380
379
  pkceMethod: 'S256',
381
380
  checkLoginIframe: false,
@@ -383,7 +382,7 @@ export async function initKeycloak() {
383
382
  };
384
383
 
385
384
  // Устанавливаем onLoad только если нужно
386
- if (KEYCLOAK_LOGIN_REQUIRED || (APP_NAME !== AppNameEnum.PASSPORT)) {
385
+ if (isNeedAuth && (KEYCLOAK_LOGIN_REQUIRED || (APP_NAME !== AppNameEnum.PASSPORT))) {
387
386
  initOptions.onLoad = 'login-required';
388
387
  } else if (isNeedAuth) {
389
388
  initOptions.onLoad = 'check-sso';