cidaas-javascript-sdk 4.2.2 → 4.2.3

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/CHANGELOG.md CHANGED
@@ -1,14 +1,17 @@
1
- ## [4.2.2](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.2.1...v4.2.2) (2024-04-08)
1
+ ## [4.2.3](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.2.2...v4.2.3) (2024-04-12)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * Fix compatibility with es2016 ([6025bbf](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/6025bbf0e81f1b42308c44d59bd62d05f4bd0556))
7
- * Fix popup sign out callback not falling back post_logout_redirect_uri ([01cd31f](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/01cd31f01c04220ede7c3e2f414d975e7a95cc67))
8
- * Fix unable to import authentication module models ([565e0c4](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/565e0c4721834ed53037d2ca8efa616389945da7))
6
+ * semantic release format ([8c972c5](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/8c972c5a4666a399f78164f2f2e1c8b1b667b4bd))
9
7
 
10
8
  # Changelog
11
9
 
10
+ ## V4.2.3
11
+
12
+ ### Added
13
+ - Add back loginAfterRegister functionality
14
+
12
15
  ## V4.2.2
13
16
 
14
17
  ### Fixed
package/README.md CHANGED
@@ -131,6 +131,7 @@ The login functions could be found [here](https://github.com/Cidaas/cidaas-javas
131
131
  | passwordlessLogin, loginWithCredentials, loginWithSocial | User could authenticate themselves using passwordless authentication, classic password credentials, as well as using social provider such as google or social media platform |
132
132
  | loginPrecheck, consentContinue, firstTimeChangePassword, mfaContinue | Depending on the missing information from loginPrecheck, user will be redirected to another page after login to either accepting consent, changing password, continuing MFA process, or do progressive registration |
133
133
  | getMissingFields, progressiveRegistration | In case a new required field is added in registration settings, it is possible to use the sdk to inform user of the changes and asked them to fill in the missing required fields by the next login |
134
+ | loginAfterRegister | By calling this sdk function, user could directly login to the app after successful registration |
134
135
 
135
136
  #### User Management
136
137
 
@@ -201,3 +202,4 @@ The SDK will throws Custom Exception if something went wrong during the operatio
201
202
  |----------------- | ----------------------- |
202
203
  | 500 | during creation of WebAuth instance |
203
204
  | 417 | if there are any other failure |
205
+
@@ -141,4 +141,25 @@ export declare namespace LoginService {
141
141
  trackId: string;
142
142
  acceptlanguage: string;
143
143
  }): Promise<unknown>;
144
+ /**
145
+ * To automatically do user login after successful registration, call **loginAfterRegister()**. Make sure to turn on "auto login after register" switch on the admin ui to activate loginAfterRegister flow.
146
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qwwamc2f378wi-auto-login-after-register for more details.
147
+ * @example
148
+ * ```js
149
+ * cidaas.loginAfterRegister({
150
+ * device_id: 'your device id',
151
+ * dc: 'device capacity'
152
+ * rememberMe: false,
153
+ * trackId: 'your track id',
154
+ * device_fp: 'device fingerprint'
155
+ * });
156
+ * ```
157
+ */
158
+ function loginAfterRegister(options: {
159
+ device_id?: string;
160
+ dc?: string;
161
+ rememberMe?: boolean;
162
+ trackId?: string;
163
+ device_fp?: string;
164
+ }): void;
144
165
  }
@@ -213,4 +213,31 @@ export var LoginService;
213
213
  }
214
214
  LoginService.progressiveRegistration = progressiveRegistration;
215
215
  ;
216
+ /**
217
+ * To automatically do user login after successful registration, call **loginAfterRegister()**. Make sure to turn on "auto login after register" switch on the admin ui to activate loginAfterRegister flow.
218
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qwwamc2f378wi-auto-login-after-register for more details.
219
+ * @example
220
+ * ```js
221
+ * cidaas.loginAfterRegister({
222
+ * device_id: 'your device id',
223
+ * dc: 'device capacity'
224
+ * rememberMe: false,
225
+ * trackId: 'your track id',
226
+ * device_fp: 'device fingerprint'
227
+ * });
228
+ * ```
229
+ */
230
+ function loginAfterRegister(options) {
231
+ try {
232
+ const url = window.webAuthSettings.authority + "/login-srv/login/handle/afterregister/" + options.trackId;
233
+ let form = Helper.createForm(url, options);
234
+ document.body.appendChild(form);
235
+ form.submit();
236
+ }
237
+ catch (ex) {
238
+ throw new CustomException(ex, 417);
239
+ }
240
+ }
241
+ LoginService.loginAfterRegister = loginAfterRegister;
242
+ ;
216
243
  })(LoginService || (LoginService = {}));
@@ -645,6 +645,16 @@ export declare class WebAuth {
645
645
  trackId: string;
646
646
  acceptlanguage: string;
647
647
  }): Promise<unknown>;
648
+ /**
649
+ * loginAfterRegister
650
+ * @param options
651
+ */
652
+ loginAfterRegister(options: {
653
+ device_id: string;
654
+ dc?: string;
655
+ rememberMe: boolean;
656
+ trackId: string;
657
+ }): void;
648
658
  /**
649
659
  * device code flow - initiate
650
660
  */
@@ -877,6 +877,14 @@ export class WebAuth {
877
877
  return LoginService.progressiveRegistration(options, headers);
878
878
  }
879
879
  ;
880
+ /**
881
+ * loginAfterRegister
882
+ * @param options
883
+ */
884
+ loginAfterRegister(options) {
885
+ LoginService.loginAfterRegister(options);
886
+ }
887
+ ;
880
888
  /**
881
889
  * device code flow - initiate
882
890
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cidaas-javascript-sdk",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "author": "cidaas by Widas ID GmbH",
5
5
  "description": "Cidaas native javascript sdk",
6
6
  "license": "MIT",
@@ -26,7 +26,6 @@
26
26
  "registry": "https://registry.npmjs.org/"
27
27
  },
28
28
  "dependencies": {
29
- "@fingerprintjs/fingerprintjs": "^3.4.0",
30
29
  "@toolz/is-a-regular-object": "^1.0.1",
31
30
  "oidc-client-ts": "^2.4.0"
32
31
  },