@stytch/vanilla-js 4.3.0 → 4.3.2
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 +15 -0
- package/dist/b2b/index.esm.js +58 -38
- package/dist/b2b/index.headless.esm.js +35 -16
- package/dist/b2b/index.headless.js +35 -16
- package/dist/b2b/index.js +58 -38
- package/dist/index.esm.js +34 -15
- package/dist/index.headless.esm.js +67 -48
- package/dist/index.headless.js +34 -15
- package/dist/index.js +350 -331
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @stytch/vanilla-js
|
|
2
2
|
|
|
3
|
+
## 4.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [61417c3]
|
|
8
|
+
- @stytch/core@2.4.2
|
|
9
|
+
|
|
10
|
+
## 4.3.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 3ca7557: Honor `hideHeaderText` configuration for B2B UI
|
|
15
|
+
- Updated dependencies [e21c507]
|
|
16
|
+
- @stytch/core@2.4.1
|
|
17
|
+
|
|
3
18
|
## 4.3.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/b2b/index.esm.js
CHANGED
|
@@ -2643,36 +2643,55 @@ var qe = Promise.resolve({
|
|
|
2643
2643
|
}));
|
|
2644
2644
|
}, this.authenticate = function (e) {
|
|
2645
2645
|
return we(r, void 0, void 0, de().mark(function t() {
|
|
2646
|
-
var n,
|
|
2646
|
+
var n,
|
|
2647
|
+
r,
|
|
2648
|
+
i,
|
|
2649
|
+
o,
|
|
2650
|
+
a = this;
|
|
2647
2651
|
return de().wrap(function (t) {
|
|
2648
2652
|
for (;;) switch (t.prev = t.next) {
|
|
2649
2653
|
case 0:
|
|
2650
|
-
return
|
|
2654
|
+
return n = this._subscriptionService.getSession(), r = function r() {
|
|
2655
|
+
var e;
|
|
2656
|
+
return (null == n ? void 0 : n.member_session_id) !== (null === (e = a._subscriptionService.getSession()) || void 0 === e ? void 0 : e.member_session_id);
|
|
2657
|
+
}, t.prev = 2, i = {
|
|
2651
2658
|
session_duration_minutes: null == e ? void 0 : e.session_duration_minutes
|
|
2652
|
-
}, t.next =
|
|
2659
|
+
}, t.next = 6, this._networkClient.fetchSDK({
|
|
2653
2660
|
url: "/b2b/sessions/authenticate",
|
|
2654
|
-
body:
|
|
2661
|
+
body: i,
|
|
2655
2662
|
errorMessage: "Error authenticating session",
|
|
2656
2663
|
method: "POST"
|
|
2657
2664
|
});
|
|
2658
|
-
case
|
|
2659
|
-
|
|
2665
|
+
case 6:
|
|
2666
|
+
if (o = t.sent, !r()) {
|
|
2667
|
+
t.next = 9;
|
|
2668
|
+
break;
|
|
2669
|
+
}
|
|
2670
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2671
|
+
case 9:
|
|
2672
|
+
return this._subscriptionService.updateStateAndTokens({
|
|
2660
2673
|
state: {
|
|
2661
|
-
session:
|
|
2662
|
-
member:
|
|
2663
|
-
organization:
|
|
2674
|
+
session: o.member_session,
|
|
2675
|
+
member: o.member,
|
|
2676
|
+
organization: o.organization
|
|
2664
2677
|
},
|
|
2665
|
-
session_token:
|
|
2666
|
-
session_jwt:
|
|
2678
|
+
session_token: o.session_token,
|
|
2679
|
+
session_jwt: o.session_jwt,
|
|
2667
2680
|
intermediate_session_token: null
|
|
2668
|
-
}), t.abrupt("return",
|
|
2669
|
-
case 9:
|
|
2670
|
-
throw t.prev = 9, t.t0 = t["catch"](0), C.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2681
|
+
}), t.abrupt("return", o);
|
|
2671
2682
|
case 13:
|
|
2683
|
+
if (t.prev = 13, t.t0 = t["catch"](2), !r()) {
|
|
2684
|
+
t.next = 17;
|
|
2685
|
+
break;
|
|
2686
|
+
}
|
|
2687
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2688
|
+
case 17:
|
|
2689
|
+
throw C.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2690
|
+
case 19:
|
|
2672
2691
|
case "end":
|
|
2673
2692
|
return t.stop();
|
|
2674
2693
|
}
|
|
2675
|
-
}, t, this, [[
|
|
2694
|
+
}, t, this, [[2, 13]]);
|
|
2676
2695
|
}));
|
|
2677
2696
|
}, this.exchange = function (e) {
|
|
2678
2697
|
return we(r, void 0, void 0, de().mark(function t() {
|
|
@@ -3900,7 +3919,7 @@ var Ct = /*#__PURE__*/function () {
|
|
|
3900
3919
|
},
|
|
3901
3920
|
sdk: {
|
|
3902
3921
|
identifier: "Stytch.js Javascript SDK",
|
|
3903
|
-
version: "4.3.
|
|
3922
|
+
version: "4.3.2"
|
|
3904
3923
|
}
|
|
3905
3924
|
});
|
|
3906
3925
|
}
|
|
@@ -10337,21 +10356,22 @@ var Wu = Ja($c)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral
|
|
|
10337
10356
|
Xu = function Xu() {
|
|
10338
10357
|
var e, t, n, r, i, o, a;
|
|
10339
10358
|
var _Ga = Ga(),
|
|
10340
|
-
s = _Ga.
|
|
10341
|
-
c =
|
|
10359
|
+
s = _Ga.displayHeader,
|
|
10360
|
+
c = _Ga.logo,
|
|
10361
|
+
l = ss(),
|
|
10342
10362
|
_as19 = as(),
|
|
10343
10363
|
_as20 = _slicedToArray(_as19, 1),
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
var
|
|
10347
|
-
if ("RESTRICTED" === (null === (e =
|
|
10348
|
-
(null !== (n = null === (t =
|
|
10349
|
-
"sso" === e &&
|
|
10350
|
-
}),
|
|
10351
|
-
return
|
|
10364
|
+
u = _as20[0],
|
|
10365
|
+
d = [];
|
|
10366
|
+
var p = l.products;
|
|
10367
|
+
if ("RESTRICTED" === (null === (e = u.flowState.organization) || void 0 === e ? void 0 : e.auth_methods)) {
|
|
10368
|
+
(null !== (n = null === (t = u.flowState.organization) || void 0 === t ? void 0 : t.allowed_auth_methods) && void 0 !== n ? n : []).forEach(function (e) {
|
|
10369
|
+
"sso" === e && d.push(A.sso), "magic_link" === e && d.push(A.emailMagicLinks), "password" === e && d.push(A.passwords), "google_oauth" !== e && "microsoft_oauth" !== e || d.push(A.oauth);
|
|
10370
|
+
}), p = p.filter(function (e) {
|
|
10371
|
+
return d.includes(e);
|
|
10352
10372
|
});
|
|
10353
10373
|
}
|
|
10354
|
-
var
|
|
10374
|
+
var h = function (e, t) {
|
|
10355
10375
|
var n = e.includes(A.emailMagicLinks) && e.includes(A.passwords),
|
|
10356
10376
|
r = e.map(function (e) {
|
|
10357
10377
|
switch (e) {
|
|
@@ -10378,29 +10398,29 @@ var Wu = Ja($c)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral
|
|
|
10378
10398
|
o = e.includes(A.emailMagicLinks) || e.includes(A.passwords),
|
|
10379
10399
|
a = i && o;
|
|
10380
10400
|
return r.length > 1 && a && r.splice(r.length - 1, 0, qu.Divider), r;
|
|
10381
|
-
}(
|
|
10382
|
-
var
|
|
10383
|
-
switch (
|
|
10401
|
+
}(p, u.flowState.type);
|
|
10402
|
+
var f;
|
|
10403
|
+
switch (u.flowState.type) {
|
|
10384
10404
|
case v.Discovery:
|
|
10385
|
-
|
|
10405
|
+
f = "Sign up or log in";
|
|
10386
10406
|
break;
|
|
10387
10407
|
case v.PasswordReset:
|
|
10388
|
-
|
|
10408
|
+
f = "";
|
|
10389
10409
|
break;
|
|
10390
10410
|
default:
|
|
10391
|
-
|
|
10411
|
+
f = "Continue to ".concat(null !== (i = null === (r = u.flowState.organization) || void 0 === r ? void 0 : r.organization_name) && void 0 !== i ? i : "...");
|
|
10392
10412
|
}
|
|
10393
10413
|
return ui.createElement(Wu, {
|
|
10394
10414
|
direction: "column"
|
|
10395
10415
|
}, ui.createElement(Yu, {
|
|
10396
|
-
appLogo:
|
|
10397
|
-
orgLogo: null !== (a = null === (o =
|
|
10398
|
-
}),
|
|
10416
|
+
appLogo: c.logoImageUrl,
|
|
10417
|
+
orgLogo: null !== (a = null === (o = u.flowState.organization) || void 0 === o ? void 0 : o.organization_logo_url) && void 0 !== a ? a : ""
|
|
10418
|
+
}), s && f ? ui.createElement($c, {
|
|
10399
10419
|
justifyContent: "center"
|
|
10400
10420
|
}, ui.createElement(Ju, {
|
|
10401
10421
|
size: "header"
|
|
10402
|
-
},
|
|
10403
|
-
components:
|
|
10422
|
+
}, f)) : ui.createElement(ui.Fragment, null), ui.createElement(Zu, {
|
|
10423
|
+
components: h
|
|
10404
10424
|
}));
|
|
10405
10425
|
};
|
|
10406
10426
|
var ed = Uu("gmail", function () {
|
|
@@ -2641,36 +2641,55 @@ var Ye = Promise.resolve({
|
|
|
2641
2641
|
}));
|
|
2642
2642
|
}, this.authenticate = function (e) {
|
|
2643
2643
|
return we(n, void 0, void 0, de().mark(function t() {
|
|
2644
|
-
var r,
|
|
2644
|
+
var r,
|
|
2645
|
+
n,
|
|
2646
|
+
i,
|
|
2647
|
+
o,
|
|
2648
|
+
s = this;
|
|
2645
2649
|
return de().wrap(function (t) {
|
|
2646
2650
|
for (;;) switch (t.prev = t.next) {
|
|
2647
2651
|
case 0:
|
|
2648
|
-
return
|
|
2652
|
+
return r = this._subscriptionService.getSession(), n = function n() {
|
|
2653
|
+
var e;
|
|
2654
|
+
return (null == r ? void 0 : r.member_session_id) !== (null === (e = s._subscriptionService.getSession()) || void 0 === e ? void 0 : e.member_session_id);
|
|
2655
|
+
}, t.prev = 2, i = {
|
|
2649
2656
|
session_duration_minutes: null == e ? void 0 : e.session_duration_minutes
|
|
2650
|
-
}, t.next =
|
|
2657
|
+
}, t.next = 6, this._networkClient.fetchSDK({
|
|
2651
2658
|
url: "/b2b/sessions/authenticate",
|
|
2652
|
-
body:
|
|
2659
|
+
body: i,
|
|
2653
2660
|
errorMessage: "Error authenticating session",
|
|
2654
2661
|
method: "POST"
|
|
2655
2662
|
});
|
|
2656
|
-
case
|
|
2657
|
-
|
|
2663
|
+
case 6:
|
|
2664
|
+
if (o = t.sent, !n()) {
|
|
2665
|
+
t.next = 9;
|
|
2666
|
+
break;
|
|
2667
|
+
}
|
|
2668
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2669
|
+
case 9:
|
|
2670
|
+
return this._subscriptionService.updateStateAndTokens({
|
|
2658
2671
|
state: {
|
|
2659
|
-
session:
|
|
2660
|
-
member:
|
|
2661
|
-
organization:
|
|
2672
|
+
session: o.member_session,
|
|
2673
|
+
member: o.member,
|
|
2674
|
+
organization: o.organization
|
|
2662
2675
|
},
|
|
2663
|
-
session_token:
|
|
2664
|
-
session_jwt:
|
|
2676
|
+
session_token: o.session_token,
|
|
2677
|
+
session_jwt: o.session_jwt,
|
|
2665
2678
|
intermediate_session_token: null
|
|
2666
|
-
}), t.abrupt("return",
|
|
2667
|
-
case 9:
|
|
2668
|
-
throw t.prev = 9, t.t0 = t["catch"](0), A.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2679
|
+
}), t.abrupt("return", o);
|
|
2669
2680
|
case 13:
|
|
2681
|
+
if (t.prev = 13, t.t0 = t["catch"](2), !n()) {
|
|
2682
|
+
t.next = 17;
|
|
2683
|
+
break;
|
|
2684
|
+
}
|
|
2685
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2686
|
+
case 17:
|
|
2687
|
+
throw A.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2688
|
+
case 19:
|
|
2670
2689
|
case "end":
|
|
2671
2690
|
return t.stop();
|
|
2672
2691
|
}
|
|
2673
|
-
}, t, this, [[
|
|
2692
|
+
}, t, this, [[2, 13]]);
|
|
2674
2693
|
}));
|
|
2675
2694
|
}, this.exchange = function (e) {
|
|
2676
2695
|
return we(n, void 0, void 0, de().mark(function t() {
|
|
@@ -3898,7 +3917,7 @@ var At = /*#__PURE__*/function () {
|
|
|
3898
3917
|
},
|
|
3899
3918
|
sdk: {
|
|
3900
3919
|
identifier: "Stytch.js Javascript SDK",
|
|
3901
|
-
version: "4.3.
|
|
3920
|
+
version: "4.3.2"
|
|
3902
3921
|
}
|
|
3903
3922
|
});
|
|
3904
3923
|
}
|
|
@@ -2573,36 +2573,55 @@ var Fe = Promise.resolve({
|
|
|
2573
2573
|
}));
|
|
2574
2574
|
}, this.authenticate = function (e) {
|
|
2575
2575
|
return he(n, void 0, void 0, te().mark(function t() {
|
|
2576
|
-
var r,
|
|
2576
|
+
var r,
|
|
2577
|
+
n,
|
|
2578
|
+
i,
|
|
2579
|
+
o,
|
|
2580
|
+
s = this;
|
|
2577
2581
|
return te().wrap(function (t) {
|
|
2578
2582
|
for (;;) switch (t.prev = t.next) {
|
|
2579
2583
|
case 0:
|
|
2580
|
-
return
|
|
2584
|
+
return r = this._subscriptionService.getSession(), n = function n() {
|
|
2585
|
+
var e;
|
|
2586
|
+
return (null == r ? void 0 : r.member_session_id) !== (null === (e = s._subscriptionService.getSession()) || void 0 === e ? void 0 : e.member_session_id);
|
|
2587
|
+
}, t.prev = 2, i = {
|
|
2581
2588
|
session_duration_minutes: null == e ? void 0 : e.session_duration_minutes
|
|
2582
|
-
}, t.next =
|
|
2589
|
+
}, t.next = 6, this._networkClient.fetchSDK({
|
|
2583
2590
|
url: "/b2b/sessions/authenticate",
|
|
2584
|
-
body:
|
|
2591
|
+
body: i,
|
|
2585
2592
|
errorMessage: "Error authenticating session",
|
|
2586
2593
|
method: "POST"
|
|
2587
2594
|
});
|
|
2588
|
-
case
|
|
2589
|
-
|
|
2595
|
+
case 6:
|
|
2596
|
+
if (o = t.sent, !n()) {
|
|
2597
|
+
t.next = 9;
|
|
2598
|
+
break;
|
|
2599
|
+
}
|
|
2600
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2601
|
+
case 9:
|
|
2602
|
+
return this._subscriptionService.updateStateAndTokens({
|
|
2590
2603
|
state: {
|
|
2591
|
-
session:
|
|
2592
|
-
member:
|
|
2593
|
-
organization:
|
|
2604
|
+
session: o.member_session,
|
|
2605
|
+
member: o.member,
|
|
2606
|
+
organization: o.organization
|
|
2594
2607
|
},
|
|
2595
|
-
session_token:
|
|
2596
|
-
session_jwt:
|
|
2608
|
+
session_token: o.session_token,
|
|
2609
|
+
session_jwt: o.session_jwt,
|
|
2597
2610
|
intermediate_session_token: null
|
|
2598
|
-
}), t.abrupt("return",
|
|
2599
|
-
case 9:
|
|
2600
|
-
throw t.prev = 9, t.t0 = t["catch"](0), m.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2611
|
+
}), t.abrupt("return", o);
|
|
2601
2612
|
case 13:
|
|
2613
|
+
if (t.prev = 13, t.t0 = t["catch"](2), !n()) {
|
|
2614
|
+
t.next = 17;
|
|
2615
|
+
break;
|
|
2616
|
+
}
|
|
2617
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2618
|
+
case 17:
|
|
2619
|
+
throw m.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2620
|
+
case 19:
|
|
2602
2621
|
case "end":
|
|
2603
2622
|
return t.stop();
|
|
2604
2623
|
}
|
|
2605
|
-
}, t, this, [[
|
|
2624
|
+
}, t, this, [[2, 13]]);
|
|
2606
2625
|
}));
|
|
2607
2626
|
}, this.exchange = function (e) {
|
|
2608
2627
|
return he(n, void 0, void 0, te().mark(function t() {
|
|
@@ -3830,7 +3849,7 @@ var ft = /*#__PURE__*/function () {
|
|
|
3830
3849
|
},
|
|
3831
3850
|
sdk: {
|
|
3832
3851
|
identifier: "Stytch.js Javascript SDK",
|
|
3833
|
-
version: "4.3.
|
|
3852
|
+
version: "4.3.2"
|
|
3834
3853
|
}
|
|
3835
3854
|
});
|
|
3836
3855
|
}
|
package/dist/b2b/index.js
CHANGED
|
@@ -2575,36 +2575,55 @@ var je = Promise.resolve({
|
|
|
2575
2575
|
}));
|
|
2576
2576
|
}, this.authenticate = function (e) {
|
|
2577
2577
|
return pe(r, void 0, void 0, te().mark(function t() {
|
|
2578
|
-
var n,
|
|
2578
|
+
var n,
|
|
2579
|
+
r,
|
|
2580
|
+
o,
|
|
2581
|
+
i,
|
|
2582
|
+
a = this;
|
|
2579
2583
|
return te().wrap(function (t) {
|
|
2580
2584
|
for (;;) switch (t.prev = t.next) {
|
|
2581
2585
|
case 0:
|
|
2582
|
-
return
|
|
2586
|
+
return n = this._subscriptionService.getSession(), r = function r() {
|
|
2587
|
+
var e;
|
|
2588
|
+
return (null == n ? void 0 : n.member_session_id) !== (null === (e = a._subscriptionService.getSession()) || void 0 === e ? void 0 : e.member_session_id);
|
|
2589
|
+
}, t.prev = 2, o = {
|
|
2583
2590
|
session_duration_minutes: null == e ? void 0 : e.session_duration_minutes
|
|
2584
|
-
}, t.next =
|
|
2591
|
+
}, t.next = 6, this._networkClient.fetchSDK({
|
|
2585
2592
|
url: "/b2b/sessions/authenticate",
|
|
2586
|
-
body:
|
|
2593
|
+
body: o,
|
|
2587
2594
|
errorMessage: "Error authenticating session",
|
|
2588
2595
|
method: "POST"
|
|
2589
2596
|
});
|
|
2590
|
-
case
|
|
2591
|
-
|
|
2597
|
+
case 6:
|
|
2598
|
+
if (i = t.sent, !r()) {
|
|
2599
|
+
t.next = 9;
|
|
2600
|
+
break;
|
|
2601
|
+
}
|
|
2602
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2603
|
+
case 9:
|
|
2604
|
+
return this._subscriptionService.updateStateAndTokens({
|
|
2592
2605
|
state: {
|
|
2593
|
-
session:
|
|
2594
|
-
member:
|
|
2595
|
-
organization:
|
|
2606
|
+
session: i.member_session,
|
|
2607
|
+
member: i.member,
|
|
2608
|
+
organization: i.organization
|
|
2596
2609
|
},
|
|
2597
|
-
session_token:
|
|
2598
|
-
session_jwt:
|
|
2610
|
+
session_token: i.session_token,
|
|
2611
|
+
session_jwt: i.session_jwt,
|
|
2599
2612
|
intermediate_session_token: null
|
|
2600
|
-
}), t.abrupt("return",
|
|
2601
|
-
case 9:
|
|
2602
|
-
throw t.prev = 9, t.t0 = t["catch"](0), _.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2613
|
+
}), t.abrupt("return", i);
|
|
2603
2614
|
case 13:
|
|
2615
|
+
if (t.prev = 13, t.t0 = t["catch"](2), !r()) {
|
|
2616
|
+
t.next = 17;
|
|
2617
|
+
break;
|
|
2618
|
+
}
|
|
2619
|
+
return t.abrupt("return", this.authenticate(e));
|
|
2620
|
+
case 17:
|
|
2621
|
+
throw _.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2622
|
+
case 19:
|
|
2604
2623
|
case "end":
|
|
2605
2624
|
return t.stop();
|
|
2606
2625
|
}
|
|
2607
|
-
}, t, this, [[
|
|
2626
|
+
}, t, this, [[2, 13]]);
|
|
2608
2627
|
}));
|
|
2609
2628
|
}, this.exchange = function (e) {
|
|
2610
2629
|
return pe(r, void 0, void 0, te().mark(function t() {
|
|
@@ -3832,7 +3851,7 @@ var mt = /*#__PURE__*/function () {
|
|
|
3832
3851
|
},
|
|
3833
3852
|
sdk: {
|
|
3834
3853
|
identifier: "Stytch.js Javascript SDK",
|
|
3835
|
-
version: "4.3.
|
|
3854
|
+
version: "4.3.2"
|
|
3836
3855
|
}
|
|
3837
3856
|
});
|
|
3838
3857
|
}
|
|
@@ -10269,21 +10288,22 @@ var Fu = Na(Rc)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral
|
|
|
10269
10288
|
$u = function $u() {
|
|
10270
10289
|
var e, t, n, r, o, i, a;
|
|
10271
10290
|
var _za = za(),
|
|
10272
|
-
s = _za.
|
|
10273
|
-
c =
|
|
10291
|
+
s = _za.displayHeader,
|
|
10292
|
+
c = _za.logo,
|
|
10293
|
+
l = Ya(),
|
|
10274
10294
|
_Ja19 = Ja(),
|
|
10275
10295
|
_Ja20 = _slicedToArray(_Ja19, 1),
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
var
|
|
10279
|
-
if ("RESTRICTED" === (null === (e =
|
|
10280
|
-
(null !== (n = null === (t =
|
|
10281
|
-
"sso" === e &&
|
|
10282
|
-
}),
|
|
10283
|
-
return
|
|
10296
|
+
u = _Ja20[0],
|
|
10297
|
+
d = [];
|
|
10298
|
+
var p = l.products;
|
|
10299
|
+
if ("RESTRICTED" === (null === (e = u.flowState.organization) || void 0 === e ? void 0 : e.auth_methods)) {
|
|
10300
|
+
(null !== (n = null === (t = u.flowState.organization) || void 0 === t ? void 0 : t.allowed_auth_methods) && void 0 !== n ? n : []).forEach(function (e) {
|
|
10301
|
+
"sso" === e && d.push(exports.B2BProducts.sso), "magic_link" === e && d.push(exports.B2BProducts.emailMagicLinks), "password" === e && d.push(exports.B2BProducts.passwords), "google_oauth" !== e && "microsoft_oauth" !== e || d.push(exports.B2BProducts.oauth);
|
|
10302
|
+
}), p = p.filter(function (e) {
|
|
10303
|
+
return d.includes(e);
|
|
10284
10304
|
});
|
|
10285
10305
|
}
|
|
10286
|
-
var
|
|
10306
|
+
var h = function (e, t) {
|
|
10287
10307
|
var n = e.includes(exports.B2BProducts.emailMagicLinks) && e.includes(exports.B2BProducts.passwords),
|
|
10288
10308
|
r = e.map(function (e) {
|
|
10289
10309
|
switch (e) {
|
|
@@ -10310,29 +10330,29 @@ var Fu = Na(Rc)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral
|
|
|
10310
10330
|
i = e.includes(exports.B2BProducts.emailMagicLinks) || e.includes(exports.B2BProducts.passwords),
|
|
10311
10331
|
a = o && i;
|
|
10312
10332
|
return r.length > 1 && a && r.splice(r.length - 1, 0, ju.Divider), r;
|
|
10313
|
-
}(
|
|
10314
|
-
var
|
|
10315
|
-
switch (
|
|
10333
|
+
}(p, u.flowState.type);
|
|
10334
|
+
var f;
|
|
10335
|
+
switch (u.flowState.type) {
|
|
10316
10336
|
case exports.AuthFlowType.Discovery:
|
|
10317
|
-
|
|
10337
|
+
f = "Sign up or log in";
|
|
10318
10338
|
break;
|
|
10319
10339
|
case exports.AuthFlowType.PasswordReset:
|
|
10320
|
-
|
|
10340
|
+
f = "";
|
|
10321
10341
|
break;
|
|
10322
10342
|
default:
|
|
10323
|
-
|
|
10343
|
+
f = "Continue to ".concat(null !== (o = null === (r = u.flowState.organization) || void 0 === r ? void 0 : r.organization_name) && void 0 !== o ? o : "...");
|
|
10324
10344
|
}
|
|
10325
10345
|
return eo.createElement(Fu, {
|
|
10326
10346
|
direction: "column"
|
|
10327
10347
|
}, eo.createElement(Uu, {
|
|
10328
|
-
appLogo:
|
|
10329
|
-
orgLogo: null !== (a = null === (i =
|
|
10330
|
-
}),
|
|
10348
|
+
appLogo: c.logoImageUrl,
|
|
10349
|
+
orgLogo: null !== (a = null === (i = u.flowState.organization) || void 0 === i ? void 0 : i.organization_logo_url) && void 0 !== a ? a : ""
|
|
10350
|
+
}), s && f ? eo.createElement(Rc, {
|
|
10331
10351
|
justifyContent: "center"
|
|
10332
10352
|
}, eo.createElement(Nu, {
|
|
10333
10353
|
size: "header"
|
|
10334
|
-
},
|
|
10335
|
-
components:
|
|
10354
|
+
}, f)) : eo.createElement(eo.Fragment, null), eo.createElement(Qu, {
|
|
10355
|
+
components: h
|
|
10336
10356
|
}));
|
|
10337
10357
|
};
|
|
10338
10358
|
var Ku = Bu("gmail", function () {
|
package/dist/index.esm.js
CHANGED
|
@@ -1881,35 +1881,54 @@ var tt = fe(function e(t, n) {
|
|
|
1881
1881
|
}));
|
|
1882
1882
|
}, this.authenticate = function (e) {
|
|
1883
1883
|
return xe(r, void 0, void 0, pe().mark(function t() {
|
|
1884
|
-
var n,
|
|
1884
|
+
var n,
|
|
1885
|
+
r,
|
|
1886
|
+
i,
|
|
1887
|
+
o,
|
|
1888
|
+
a = this;
|
|
1885
1889
|
return pe().wrap(function (t) {
|
|
1886
1890
|
for (;;) switch (t.prev = t.next) {
|
|
1887
1891
|
case 0:
|
|
1888
|
-
return
|
|
1892
|
+
return n = this._subscriptionService.getSession(), r = function r() {
|
|
1893
|
+
var e;
|
|
1894
|
+
return (null == n ? void 0 : n.session_id) !== (null === (e = a._subscriptionService.getSession()) || void 0 === e ? void 0 : e.session_id);
|
|
1895
|
+
}, t.prev = 2, i = {
|
|
1889
1896
|
session_duration_minutes: null == e ? void 0 : e.session_duration_minutes
|
|
1890
|
-
}, t.next =
|
|
1897
|
+
}, t.next = 6, this._networkClient.fetchSDK({
|
|
1891
1898
|
url: "/sessions/authenticate",
|
|
1892
|
-
body:
|
|
1899
|
+
body: i,
|
|
1893
1900
|
errorMessage: "Error authenticating session",
|
|
1894
1901
|
method: "POST"
|
|
1895
1902
|
});
|
|
1896
|
-
case
|
|
1897
|
-
|
|
1903
|
+
case 6:
|
|
1904
|
+
if (o = t.sent, !r()) {
|
|
1905
|
+
t.next = 9;
|
|
1906
|
+
break;
|
|
1907
|
+
}
|
|
1908
|
+
return t.abrupt("return", this.authenticate(e));
|
|
1909
|
+
case 9:
|
|
1910
|
+
return this._subscriptionService.updateStateAndTokens({
|
|
1898
1911
|
state: {
|
|
1899
|
-
session:
|
|
1900
|
-
user:
|
|
1912
|
+
session: o.session,
|
|
1913
|
+
user: o.user
|
|
1901
1914
|
},
|
|
1902
|
-
session_token:
|
|
1903
|
-
session_jwt:
|
|
1915
|
+
session_token: o.session_token,
|
|
1916
|
+
session_jwt: o.session_jwt,
|
|
1904
1917
|
intermediate_session_token: null
|
|
1905
|
-
}), t.abrupt("return", Ye(
|
|
1906
|
-
case 9:
|
|
1907
|
-
throw t.prev = 9, t.t0 = t["catch"](0), k.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
1918
|
+
}), t.abrupt("return", Ye(o));
|
|
1908
1919
|
case 13:
|
|
1920
|
+
if (t.prev = 13, t.t0 = t["catch"](2), !r()) {
|
|
1921
|
+
t.next = 17;
|
|
1922
|
+
break;
|
|
1923
|
+
}
|
|
1924
|
+
return t.abrupt("return", this.authenticate(e));
|
|
1925
|
+
case 17:
|
|
1926
|
+
throw k.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
1927
|
+
case 19:
|
|
1909
1928
|
case "end":
|
|
1910
1929
|
return t.stop();
|
|
1911
1930
|
}
|
|
1912
|
-
}, t, this, [[
|
|
1931
|
+
}, t, this, [[2, 13]]);
|
|
1913
1932
|
}));
|
|
1914
1933
|
};
|
|
1915
1934
|
}
|
|
@@ -3814,7 +3833,7 @@ var Qt = /*#__PURE__*/function () {
|
|
|
3814
3833
|
},
|
|
3815
3834
|
sdk: {
|
|
3816
3835
|
identifier: "Stytch.js Javascript SDK",
|
|
3817
|
-
version: "4.3.
|
|
3836
|
+
version: "4.3.2"
|
|
3818
3837
|
}
|
|
3819
3838
|
});
|
|
3820
3839
|
}
|