@alfabit/keycloak 0.0.24 → 0.0.27

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.24",
4
+ "version": "0.0.27",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
7
  "main": "src/index.ts",
@@ -20,7 +20,7 @@
20
20
  "keycloak-js": "^26.2.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@alfabit/constants": "^0.0.9",
23
+ "@alfabit/constants": "^0.0.19",
24
24
  "@intlify/unplugin-vue-i18n": "^6.0.8",
25
25
  "@tanstack/vue-query": "^5.72.0",
26
26
  "@types/lodash-es": "^4.17.12",
@@ -234,6 +234,17 @@ export const getAuthMethods = () => {
234
234
  console.warn('Keycloak not defined! #changePassword');
235
235
  }
236
236
  },
237
+ configureOtp(redirectUri?: string) {
238
+ if (keycloak.value) {
239
+ document.cookie = 'from=passport; SameSite=None; Secure';
240
+ void keycloak.value.login({
241
+ action: 'CONFIGURE_TOTP',
242
+ redirectUri: redirectUri ?? getUrl(),
243
+ });
244
+ } else {
245
+ console.warn('Keycloak not defined! #configureOtp');
246
+ }
247
+ },
237
248
  });
238
249
  return methods;
239
250
  };