@alfabit/keycloak 0.0.17 → 0.0.18

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.17",
4
+ "version": "0.0.18",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
7
  "main": "src/index.ts",
@@ -223,6 +223,17 @@ export const getAuthMethods = () => {
223
223
  console.warn('Keycloak not defined! #loginWithTelegram');
224
224
  }
225
225
  },
226
+ changePassword(redirectUri?: string) {
227
+ if (keycloak.value) {
228
+ document.cookie = 'from=passport; SameSite=None; Secure';
229
+ void keycloak.value.login({
230
+ action: 'UPDATE_PASSWORD',
231
+ redirectUri: redirectUri ?? getUrl(),
232
+ });
233
+ } else {
234
+ console.warn('Keycloak not defined! #changePassword');
235
+ }
236
+ },
226
237
  });
227
238
  return methods;
228
239
  };