@saasbase-io/core-elements 1.1.16 → 1.1.17

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/dist/index.mjs CHANGED
@@ -508,26 +508,31 @@ class pn {
508
508
  */
509
509
  startNewFlow(t) {
510
510
  return F(this, void 0, void 0, function* () {
511
- const r = zt.getConfig(), i = {
511
+ const r = zt.getConfig(), i = new URLSearchParams(this.location.search), o = {};
512
+ i.forEach((u, p) => {
513
+ o[p] = u;
514
+ }), console.log("metadata", o);
515
+ const s = {
512
516
  app_id: r.appId,
513
517
  client_secret: r.clientSecret,
514
518
  origin_url: this.location.href,
515
519
  signin_url: r.signinUrl,
516
520
  signup_url: r.signupUrl,
517
521
  locale: r.locale || "en",
518
- flow_id: this.determineFlowId(t)
519
- }, o = yield this.startFlow(t, i);
520
- if (!o.auth_result) {
521
- this.flowStateManager.saveFlowState(t, i.flow_id, o);
522
- const s = this.flowStateManager.getFlowState();
523
- s && this.flowEventBus.emit("flow:started", { flowState: s });
522
+ flow_id: this.determineFlowId(t),
523
+ metadata: o
524
+ }, a = yield this.startFlow(t, s);
525
+ if (!a.auth_result) {
526
+ this.flowStateManager.saveFlowState(t, s.flow_id, a);
527
+ const u = this.flowStateManager.getFlowState();
528
+ u && this.flowEventBus.emit("flow:started", { flowState: u });
524
529
  }
525
530
  return {
526
531
  flowType: t,
527
532
  isResumed: !1,
528
- state: o.state,
529
- render_spec: o.render_spec,
530
- auth_result: o.auth_result
533
+ state: a.state,
534
+ render_spec: a.render_spec,
535
+ auth_result: a.auth_result
531
536
  };
532
537
  });
533
538
  }