@stytch/vanilla-js 5.23.0 → 5.23.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 +14 -0
- package/dist/adminPortal/index.esm.js +1 -1
- package/dist/adminPortal/index.js +1 -1
- package/dist/b2b/index.esm.js +3 -3
- package/dist/b2b/index.headless.esm.js +3 -3
- package/dist/b2b/index.headless.js +2 -2
- package/dist/b2b/index.js +2 -2
- package/dist/{extractErrorMessage-V4BFEKkB.js → extractErrorMessage-DgzvShvw.js} +1 -1
- package/dist/{extractErrorMessage-DC1oVoQP.js → extractErrorMessage-TlhWea9A.js} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.headless.esm.js +26 -62
- package/dist/index.headless.js +26 -62
- package/dist/index.js +1 -1
- package/dist/{internal-D5ZVB86z.js → internal-ByHs3kgg.js} +57 -105
- package/dist/{internal-CoWjnxMU.js → internal-oRDwhSwL.js} +57 -105
- package/package.json +2 -2
|
@@ -2543,15 +2543,15 @@ var HeadlessB2BMagicLinksClient = /*#__PURE__*/function () {
|
|
|
2543
2543
|
key: "getCodeChallenge",
|
|
2544
2544
|
value: function getCodeChallenge() {
|
|
2545
2545
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee67() {
|
|
2546
|
-
var _yield$this$
|
|
2546
|
+
var _yield$this$_config5, pkceRequiredForEmailMagicLinks, keyPair;
|
|
2547
2547
|
return _regeneratorRuntime().wrap(function _callee67$(_context67) {
|
|
2548
2548
|
while (1) switch (_context67.prev = _context67.next) {
|
|
2549
2549
|
case 0:
|
|
2550
2550
|
_context67.next = 2;
|
|
2551
2551
|
return this._config;
|
|
2552
2552
|
case 2:
|
|
2553
|
-
_yield$this$
|
|
2554
|
-
pkceRequiredForEmailMagicLinks = _yield$this$
|
|
2553
|
+
_yield$this$_config5 = _context67.sent;
|
|
2554
|
+
pkceRequiredForEmailMagicLinks = _yield$this$_config5.pkceRequiredForEmailMagicLinks;
|
|
2555
2555
|
if (pkceRequiredForEmailMagicLinks) {
|
|
2556
2556
|
_context67.next = 6;
|
|
2557
2557
|
break;
|
|
@@ -2583,9 +2583,8 @@ var HeadlessB2BMagicLinksClient = /*#__PURE__*/function () {
|
|
|
2583
2583
|
}, {
|
|
2584
2584
|
key: "handlePKCEForAuthenticate",
|
|
2585
2585
|
value: function handlePKCEForAuthenticate(pkceManager, data) {
|
|
2586
|
-
var _a, _b;
|
|
2587
2586
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee68() {
|
|
2588
|
-
var pkPair, _yield$this$
|
|
2587
|
+
var pkPair, _yield$this$dfpProtec22, dfp_telemetry_id, captcha_token, requestBody, resp;
|
|
2589
2588
|
return _regeneratorRuntime().wrap(function _callee68$(_context68) {
|
|
2590
2589
|
while (1) switch (_context68.prev = _context68.next) {
|
|
2591
2590
|
case 0:
|
|
@@ -2594,19 +2593,8 @@ var HeadlessB2BMagicLinksClient = /*#__PURE__*/function () {
|
|
|
2594
2593
|
case 2:
|
|
2595
2594
|
pkPair = _context68.sent;
|
|
2596
2595
|
_context68.next = 5;
|
|
2597
|
-
return this._config;
|
|
2598
|
-
case 5:
|
|
2599
|
-
_yield$this$_config8 = _context68.sent;
|
|
2600
|
-
pkceRequiredForEmailMagicLinks = _yield$this$_config8.pkceRequiredForEmailMagicLinks;
|
|
2601
|
-
if (!(pkceRequiredForEmailMagicLinks && (!pkPair || !(pkPair === null || pkPair === void 0 ? void 0 : pkPair.code_verifier) || ((_b = (_a = pkPair === null || pkPair === void 0 ? void 0 : pkPair.code_verifier) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) === 0))) {
|
|
2602
|
-
_context68.next = 9;
|
|
2603
|
-
break;
|
|
2604
|
-
}
|
|
2605
|
-
throw new MissingPKCEError();
|
|
2606
|
-
case 9:
|
|
2607
|
-
_context68.next = 11;
|
|
2608
2596
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2609
|
-
case
|
|
2597
|
+
case 5:
|
|
2610
2598
|
_yield$this$dfpProtec22 = _context68.sent;
|
|
2611
2599
|
dfp_telemetry_id = _yield$this$dfpProtec22.dfp_telemetry_id;
|
|
2612
2600
|
captcha_token = _yield$this$dfpProtec22.captcha_token;
|
|
@@ -2614,16 +2602,16 @@ var HeadlessB2BMagicLinksClient = /*#__PURE__*/function () {
|
|
|
2614
2602
|
_context68.t1 = pkPair === null || pkPair === void 0 ? void 0 : pkPair.code_verifier;
|
|
2615
2603
|
_context68.t2 = dfp_telemetry_id;
|
|
2616
2604
|
_context68.t3 = captcha_token;
|
|
2617
|
-
_context68.next =
|
|
2605
|
+
_context68.next = 14;
|
|
2618
2606
|
return this._subscriptionService.getIntermediateSessionToken();
|
|
2619
|
-
case
|
|
2607
|
+
case 14:
|
|
2620
2608
|
_context68.t4 = _context68.sent;
|
|
2621
2609
|
if (_context68.t4) {
|
|
2622
|
-
_context68.next =
|
|
2610
|
+
_context68.next = 17;
|
|
2623
2611
|
break;
|
|
2624
2612
|
}
|
|
2625
2613
|
_context68.t4 = undefined;
|
|
2626
|
-
case
|
|
2614
|
+
case 17:
|
|
2627
2615
|
_context68.t5 = _context68.t4;
|
|
2628
2616
|
_context68.t6 = {
|
|
2629
2617
|
pkce_code_verifier: _context68.t1,
|
|
@@ -2633,18 +2621,18 @@ var HeadlessB2BMagicLinksClient = /*#__PURE__*/function () {
|
|
|
2633
2621
|
};
|
|
2634
2622
|
_context68.t7 = data;
|
|
2635
2623
|
requestBody = _context68.t0.assign.call(_context68.t0, _context68.t6, _context68.t7);
|
|
2636
|
-
_context68.next =
|
|
2624
|
+
_context68.next = 23;
|
|
2637
2625
|
return this._networkClient.retriableFetchSDK({
|
|
2638
2626
|
url: '/b2b/magic_links/authenticate',
|
|
2639
2627
|
body: requestBody,
|
|
2640
2628
|
method: 'POST',
|
|
2641
2629
|
retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
|
|
2642
2630
|
});
|
|
2643
|
-
case
|
|
2631
|
+
case 23:
|
|
2644
2632
|
resp = _context68.sent;
|
|
2645
2633
|
pkceManager.clearPKPair();
|
|
2646
2634
|
return _context68.abrupt("return", resp);
|
|
2647
|
-
case
|
|
2635
|
+
case 26:
|
|
2648
2636
|
case "end":
|
|
2649
2637
|
return _context68.stop();
|
|
2650
2638
|
}
|
|
@@ -2989,9 +2977,8 @@ var HeadlessB2BSSOClient = /*#__PURE__*/function () {
|
|
|
2989
2977
|
return _createClass(HeadlessB2BSSOClient, [{
|
|
2990
2978
|
key: "authenticate",
|
|
2991
2979
|
value: function authenticate(options) {
|
|
2992
|
-
var _a, _b;
|
|
2993
2980
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee83() {
|
|
2994
|
-
var keyPair, _yield$this$
|
|
2981
|
+
var keyPair, _yield$this$dfpProtec23, dfp_telemetry_id, captcha_token, resp;
|
|
2995
2982
|
return _regeneratorRuntime().wrap(function _callee83$(_context83) {
|
|
2996
2983
|
while (1) switch (_context83.prev = _context83.next) {
|
|
2997
2984
|
case 0:
|
|
@@ -3000,23 +2987,12 @@ var HeadlessB2BSSOClient = /*#__PURE__*/function () {
|
|
|
3000
2987
|
return this._pkceManager.getPKPair();
|
|
3001
2988
|
case 3:
|
|
3002
2989
|
keyPair = _context83.sent;
|
|
3003
|
-
_context83.next = 6;
|
|
3004
|
-
return this._dynamicConfig;
|
|
3005
|
-
case 6:
|
|
3006
|
-
_yield$this$_dynamicC4 = _context83.sent;
|
|
3007
|
-
pkceRequiredForSso = _yield$this$_dynamicC4.pkceRequiredForSso;
|
|
3008
|
-
if (!(pkceRequiredForSso && (!keyPair || !(keyPair === null || keyPair === void 0 ? void 0 : keyPair.code_verifier) || ((_b = (_a = keyPair === null || keyPair === void 0 ? void 0 : keyPair.code_verifier) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) === 0))) {
|
|
3009
|
-
_context83.next = 10;
|
|
3010
|
-
break;
|
|
3011
|
-
}
|
|
3012
|
-
throw new MissingPKCEError();
|
|
3013
|
-
case 10:
|
|
3014
2990
|
if (!keyPair) {
|
|
3015
2991
|
logger.warn('No code verifier found in local storage for SSO flow.\n' + 'Consider using stytch.sso.start() to add PKCE to your SSO flows for added security.\n' + 'See https://stytch.com/docs/oauth#guides_pkce for more information.');
|
|
3016
2992
|
}
|
|
3017
|
-
_context83.next =
|
|
2993
|
+
_context83.next = 7;
|
|
3018
2994
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3019
|
-
case
|
|
2995
|
+
case 7:
|
|
3020
2996
|
_yield$this$dfpProtec23 = _context83.sent;
|
|
3021
2997
|
dfp_telemetry_id = _yield$this$dfpProtec23.dfp_telemetry_id;
|
|
3022
2998
|
captcha_token = _yield$this$dfpProtec23.captcha_token;
|
|
@@ -3027,16 +3003,16 @@ var HeadlessB2BSSOClient = /*#__PURE__*/function () {
|
|
|
3027
3003
|
}, options);
|
|
3028
3004
|
_context83.t3 = dfp_telemetry_id;
|
|
3029
3005
|
_context83.t4 = captcha_token;
|
|
3030
|
-
_context83.next =
|
|
3006
|
+
_context83.next = 17;
|
|
3031
3007
|
return this._subscriptionService.getIntermediateSessionToken();
|
|
3032
|
-
case
|
|
3008
|
+
case 17:
|
|
3033
3009
|
_context83.t5 = _context83.sent;
|
|
3034
3010
|
if (_context83.t5) {
|
|
3035
|
-
_context83.next =
|
|
3011
|
+
_context83.next = 20;
|
|
3036
3012
|
break;
|
|
3037
3013
|
}
|
|
3038
3014
|
_context83.t5 = undefined;
|
|
3039
|
-
case
|
|
3015
|
+
case 20:
|
|
3040
3016
|
_context83.t6 = _context83.t5;
|
|
3041
3017
|
_context83.t7 = {
|
|
3042
3018
|
dfp_telemetry_id: _context83.t3,
|
|
@@ -3051,14 +3027,14 @@ var HeadlessB2BSSOClient = /*#__PURE__*/function () {
|
|
|
3051
3027
|
body: _context83.t8,
|
|
3052
3028
|
retryCallback: _context83.t9
|
|
3053
3029
|
};
|
|
3054
|
-
_context83.next =
|
|
3030
|
+
_context83.next = 27;
|
|
3055
3031
|
return _context83.t0.retriableFetchSDK.call(_context83.t0, _context83.t10);
|
|
3056
|
-
case
|
|
3032
|
+
case 27:
|
|
3057
3033
|
resp = _context83.sent;
|
|
3058
3034
|
this._pkceManager.clearPKPair();
|
|
3059
3035
|
this._subscriptionService.updateSession(resp);
|
|
3060
3036
|
return _context83.abrupt("return", resp);
|
|
3061
|
-
case
|
|
3037
|
+
case 31:
|
|
3062
3038
|
case "end":
|
|
3063
3039
|
return _context83.stop();
|
|
3064
3040
|
}
|
|
@@ -3093,15 +3069,15 @@ var HeadlessB2BSSOClient = /*#__PURE__*/function () {
|
|
|
3093
3069
|
login_redirect_url = _ref7.login_redirect_url,
|
|
3094
3070
|
signup_redirect_url = _ref7.signup_redirect_url;
|
|
3095
3071
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee85() {
|
|
3096
|
-
var _yield$this$
|
|
3072
|
+
var _yield$this$_dynamicC3, pkceRequiredForSso, baseURL, startUrl, keyPair;
|
|
3097
3073
|
return _regeneratorRuntime().wrap(function _callee85$(_context85) {
|
|
3098
3074
|
while (1) switch (_context85.prev = _context85.next) {
|
|
3099
3075
|
case 0:
|
|
3100
3076
|
_context85.next = 2;
|
|
3101
3077
|
return this._dynamicConfig;
|
|
3102
3078
|
case 2:
|
|
3103
|
-
_yield$this$
|
|
3104
|
-
pkceRequiredForSso = _yield$this$
|
|
3079
|
+
_yield$this$_dynamicC3 = _context85.sent;
|
|
3080
|
+
pkceRequiredForSso = _yield$this$_dynamicC3.pkceRequiredForSso;
|
|
3105
3081
|
_context85.next = 6;
|
|
3106
3082
|
return this.getBaseApiUrl();
|
|
3107
3083
|
case 6:
|
|
@@ -3779,9 +3755,8 @@ var HeadlessB2BOAuthClient$1 = /*#__PURE__*/function () {
|
|
|
3779
3755
|
return _createClass(HeadlessB2BOAuthClient, [{
|
|
3780
3756
|
key: "authenticate",
|
|
3781
3757
|
value: function authenticate(options) {
|
|
3782
|
-
var _a, _b;
|
|
3783
3758
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee111() {
|
|
3784
|
-
var keyPair, _yield$this$
|
|
3759
|
+
var keyPair, _yield$this$dfpProtec25, dfp_telemetry_id, captcha_token, resp;
|
|
3785
3760
|
return _regeneratorRuntime().wrap(function _callee111$(_context111) {
|
|
3786
3761
|
while (1) switch (_context111.prev = _context111.next) {
|
|
3787
3762
|
case 0:
|
|
@@ -3790,23 +3765,12 @@ var HeadlessB2BOAuthClient$1 = /*#__PURE__*/function () {
|
|
|
3790
3765
|
return this._pkceManager.getPKPair();
|
|
3791
3766
|
case 3:
|
|
3792
3767
|
keyPair = _context111.sent;
|
|
3793
|
-
_context111.next = 6;
|
|
3794
|
-
return this._dynamicConfig;
|
|
3795
|
-
case 6:
|
|
3796
|
-
_yield$this$_dynamicC6 = _context111.sent;
|
|
3797
|
-
pkceRequiredForOAuth = _yield$this$_dynamicC6.pkceRequiredForOAuth;
|
|
3798
|
-
if (!(pkceRequiredForOAuth && (!keyPair || !(keyPair === null || keyPair === void 0 ? void 0 : keyPair.code_verifier) || ((_b = (_a = keyPair === null || keyPair === void 0 ? void 0 : keyPair.code_verifier) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) === 0))) {
|
|
3799
|
-
_context111.next = 10;
|
|
3800
|
-
break;
|
|
3801
|
-
}
|
|
3802
|
-
throw new MissingPKCEError();
|
|
3803
|
-
case 10:
|
|
3804
3768
|
if (!keyPair) {
|
|
3805
3769
|
logger.warn('No code verifier found in local storage for OAuth flow.\n' + 'Consider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\n' + 'See https://stytch.com/docs/oauth#guides_pkce for more information.');
|
|
3806
3770
|
}
|
|
3807
|
-
_context111.next =
|
|
3771
|
+
_context111.next = 7;
|
|
3808
3772
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
3809
|
-
case
|
|
3773
|
+
case 7:
|
|
3810
3774
|
_yield$this$dfpProtec25 = _context111.sent;
|
|
3811
3775
|
dfp_telemetry_id = _yield$this$dfpProtec25.dfp_telemetry_id;
|
|
3812
3776
|
captcha_token = _yield$this$dfpProtec25.captcha_token;
|
|
@@ -3815,16 +3779,16 @@ var HeadlessB2BOAuthClient$1 = /*#__PURE__*/function () {
|
|
|
3815
3779
|
_context111.t2 = keyPair === null || keyPair === void 0 ? void 0 : keyPair.code_verifier;
|
|
3816
3780
|
_context111.t3 = dfp_telemetry_id;
|
|
3817
3781
|
_context111.t4 = captcha_token;
|
|
3818
|
-
_context111.next =
|
|
3782
|
+
_context111.next = 17;
|
|
3819
3783
|
return this._subscriptionService.getIntermediateSessionToken();
|
|
3820
|
-
case
|
|
3784
|
+
case 17:
|
|
3821
3785
|
_context111.t5 = _context111.sent;
|
|
3822
3786
|
if (_context111.t5) {
|
|
3823
|
-
_context111.next =
|
|
3787
|
+
_context111.next = 20;
|
|
3824
3788
|
break;
|
|
3825
3789
|
}
|
|
3826
3790
|
_context111.t5 = undefined;
|
|
3827
|
-
case
|
|
3791
|
+
case 20:
|
|
3828
3792
|
_context111.t6 = _context111.t5;
|
|
3829
3793
|
_context111.t7 = {
|
|
3830
3794
|
pkce_code_verifier: _context111.t2,
|
|
@@ -3841,14 +3805,14 @@ var HeadlessB2BOAuthClient$1 = /*#__PURE__*/function () {
|
|
|
3841
3805
|
body: _context111.t9,
|
|
3842
3806
|
retryCallback: _context111.t10
|
|
3843
3807
|
};
|
|
3844
|
-
_context111.next =
|
|
3808
|
+
_context111.next = 28;
|
|
3845
3809
|
return _context111.t0.retriableFetchSDK.call(_context111.t0, _context111.t11);
|
|
3846
|
-
case
|
|
3810
|
+
case 28:
|
|
3847
3811
|
resp = _context111.sent;
|
|
3848
3812
|
this._pkceManager.clearPKPair();
|
|
3849
3813
|
this._subscriptionService.updateSession(resp);
|
|
3850
3814
|
return _context111.abrupt("return", resp);
|
|
3851
|
-
case
|
|
3815
|
+
case 32:
|
|
3852
3816
|
case "end":
|
|
3853
3817
|
return _context111.stop();
|
|
3854
3818
|
}
|
|
@@ -3859,15 +3823,15 @@ var HeadlessB2BOAuthClient$1 = /*#__PURE__*/function () {
|
|
|
3859
3823
|
key: "getBaseApiUrl",
|
|
3860
3824
|
value: function getBaseApiUrl() {
|
|
3861
3825
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee112() {
|
|
3862
|
-
var _yield$this$
|
|
3826
|
+
var _yield$this$_dynamicC4, cnameDomain;
|
|
3863
3827
|
return _regeneratorRuntime().wrap(function _callee112$(_context112) {
|
|
3864
3828
|
while (1) switch (_context112.prev = _context112.next) {
|
|
3865
3829
|
case 0:
|
|
3866
3830
|
_context112.next = 2;
|
|
3867
3831
|
return this._dynamicConfig;
|
|
3868
3832
|
case 2:
|
|
3869
|
-
_yield$this$
|
|
3870
|
-
cnameDomain = _yield$this$
|
|
3833
|
+
_yield$this$_dynamicC4 = _context112.sent;
|
|
3834
|
+
cnameDomain = _yield$this$_dynamicC4.cnameDomain;
|
|
3871
3835
|
if (!cnameDomain) {
|
|
3872
3836
|
_context112.next = 6;
|
|
3873
3837
|
break;
|
|
@@ -3900,15 +3864,15 @@ var HeadlessB2BOAuthClient$1 = /*#__PURE__*/function () {
|
|
|
3900
3864
|
custom_scopes = _ref8.custom_scopes,
|
|
3901
3865
|
provider_params = _ref8.provider_params;
|
|
3902
3866
|
return __awaiter$1(_this15, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee113() {
|
|
3903
|
-
var _yield$this$
|
|
3867
|
+
var _yield$this$_dynamicC5, pkceRequiredForOAuth, baseURL, startUrl, key, keyPair;
|
|
3904
3868
|
return _regeneratorRuntime().wrap(function _callee113$(_context113) {
|
|
3905
3869
|
while (1) switch (_context113.prev = _context113.next) {
|
|
3906
3870
|
case 0:
|
|
3907
3871
|
_context113.next = 2;
|
|
3908
3872
|
return this._dynamicConfig;
|
|
3909
3873
|
case 2:
|
|
3910
|
-
_yield$this$
|
|
3911
|
-
pkceRequiredForOAuth = _yield$this$
|
|
3874
|
+
_yield$this$_dynamicC5 = _context113.sent;
|
|
3875
|
+
pkceRequiredForOAuth = _yield$this$_dynamicC5.pkceRequiredForOAuth;
|
|
3912
3876
|
_context113.next = 6;
|
|
3913
3877
|
return this.getBaseApiUrl();
|
|
3914
3878
|
case 6:
|
|
@@ -3965,15 +3929,15 @@ var HeadlessB2BOAuthClient$1 = /*#__PURE__*/function () {
|
|
|
3965
3929
|
custom_scopes = _ref9.custom_scopes,
|
|
3966
3930
|
provider_params = _ref9.provider_params;
|
|
3967
3931
|
return __awaiter$1(_this16, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee114() {
|
|
3968
|
-
var _yield$this$
|
|
3932
|
+
var _yield$this$_dynamicC6, pkceRequiredForOAuth, baseURL, startUrl, key, keyPair;
|
|
3969
3933
|
return _regeneratorRuntime().wrap(function _callee114$(_context114) {
|
|
3970
3934
|
while (1) switch (_context114.prev = _context114.next) {
|
|
3971
3935
|
case 0:
|
|
3972
3936
|
_context114.next = 2;
|
|
3973
3937
|
return this._dynamicConfig;
|
|
3974
3938
|
case 2:
|
|
3975
|
-
_yield$this$
|
|
3976
|
-
pkceRequiredForOAuth = _yield$this$
|
|
3939
|
+
_yield$this$_dynamicC6 = _context114.sent;
|
|
3940
|
+
pkceRequiredForOAuth = _yield$this$_dynamicC6.pkceRequiredForOAuth;
|
|
3977
3941
|
_context114.next = 6;
|
|
3978
3942
|
return this.getBaseApiUrl();
|
|
3979
3943
|
case 6:
|
|
@@ -4501,15 +4465,15 @@ var HeadlessB2BPasswordsClient = /*#__PURE__*/function () {
|
|
|
4501
4465
|
key: "getCodeChallenge",
|
|
4502
4466
|
value: function getCodeChallenge() {
|
|
4503
4467
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee126() {
|
|
4504
|
-
var _yield$this$
|
|
4468
|
+
var _yield$this$_config6, pkceRequiredForPasswordResets, keyPair;
|
|
4505
4469
|
return _regeneratorRuntime().wrap(function _callee126$(_context126) {
|
|
4506
4470
|
while (1) switch (_context126.prev = _context126.next) {
|
|
4507
4471
|
case 0:
|
|
4508
4472
|
_context126.next = 2;
|
|
4509
4473
|
return this._config;
|
|
4510
4474
|
case 2:
|
|
4511
|
-
_yield$this$
|
|
4512
|
-
pkceRequiredForPasswordResets = _yield$this$
|
|
4475
|
+
_yield$this$_config6 = _context126.sent;
|
|
4476
|
+
pkceRequiredForPasswordResets = _yield$this$_config6.pkceRequiredForPasswordResets;
|
|
4513
4477
|
if (pkceRequiredForPasswordResets) {
|
|
4514
4478
|
_context126.next = 6;
|
|
4515
4479
|
break;
|
|
@@ -4541,9 +4505,8 @@ var HeadlessB2BPasswordsClient = /*#__PURE__*/function () {
|
|
|
4541
4505
|
}, {
|
|
4542
4506
|
key: "authenticate",
|
|
4543
4507
|
value: function authenticate(options) {
|
|
4544
|
-
var _a, _b;
|
|
4545
4508
|
return __awaiter$1(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee127() {
|
|
4546
|
-
var pkPair,
|
|
4509
|
+
var pkPair, code_verifier, _yield$this$dfpProtec29, dfp_telemetry_id, captcha_token, resp;
|
|
4547
4510
|
return _regeneratorRuntime().wrap(function _callee127$(_context127) {
|
|
4548
4511
|
while (1) switch (_context127.prev = _context127.next) {
|
|
4549
4512
|
case 0:
|
|
@@ -4552,21 +4515,10 @@ var HeadlessB2BPasswordsClient = /*#__PURE__*/function () {
|
|
|
4552
4515
|
return this._pkceManager.getPKPair();
|
|
4553
4516
|
case 3:
|
|
4554
4517
|
pkPair = _context127.sent;
|
|
4555
|
-
_context127.next = 6;
|
|
4556
|
-
return this._config;
|
|
4557
|
-
case 6:
|
|
4558
|
-
_yield$this$_config10 = _context127.sent;
|
|
4559
|
-
pkceRequiredForPasswordResets = _yield$this$_config10.pkceRequiredForPasswordResets;
|
|
4560
|
-
if (!(pkceRequiredForPasswordResets && (!pkPair || !(pkPair === null || pkPair === void 0 ? void 0 : pkPair.code_verifier) || ((_b = (_a = pkPair === null || pkPair === void 0 ? void 0 : pkPair.code_verifier) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) === 0))) {
|
|
4561
|
-
_context127.next = 10;
|
|
4562
|
-
break;
|
|
4563
|
-
}
|
|
4564
|
-
throw new MissingPKCEError();
|
|
4565
|
-
case 10:
|
|
4566
4518
|
code_verifier = pkPair === null || pkPair === void 0 ? void 0 : pkPair.code_verifier;
|
|
4567
|
-
_context127.next =
|
|
4519
|
+
_context127.next = 7;
|
|
4568
4520
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
4569
|
-
case
|
|
4521
|
+
case 7:
|
|
4570
4522
|
_yield$this$dfpProtec29 = _context127.sent;
|
|
4571
4523
|
dfp_telemetry_id = _yield$this$dfpProtec29.dfp_telemetry_id;
|
|
4572
4524
|
captcha_token = _yield$this$dfpProtec29.captcha_token;
|
|
@@ -4579,16 +4531,16 @@ var HeadlessB2BPasswordsClient = /*#__PURE__*/function () {
|
|
|
4579
4531
|
_context127.t6 = captcha_token;
|
|
4580
4532
|
_context127.t7 = dfp_telemetry_id;
|
|
4581
4533
|
_context127.t8 = code_verifier;
|
|
4582
|
-
_context127.next =
|
|
4534
|
+
_context127.next = 21;
|
|
4583
4535
|
return this._subscriptionService.getIntermediateSessionToken();
|
|
4584
|
-
case
|
|
4536
|
+
case 21:
|
|
4585
4537
|
_context127.t9 = _context127.sent;
|
|
4586
4538
|
if (_context127.t9) {
|
|
4587
|
-
_context127.next =
|
|
4539
|
+
_context127.next = 24;
|
|
4588
4540
|
break;
|
|
4589
4541
|
}
|
|
4590
4542
|
_context127.t9 = undefined;
|
|
4591
|
-
case
|
|
4543
|
+
case 24:
|
|
4592
4544
|
_context127.t10 = _context127.t9;
|
|
4593
4545
|
_context127.t11 = {
|
|
4594
4546
|
organization_id: _context127.t1,
|
|
@@ -4608,13 +4560,13 @@ var HeadlessB2BPasswordsClient = /*#__PURE__*/function () {
|
|
|
4608
4560
|
body: _context127.t11,
|
|
4609
4561
|
retryCallback: _context127.t12
|
|
4610
4562
|
};
|
|
4611
|
-
_context127.next =
|
|
4563
|
+
_context127.next = 30;
|
|
4612
4564
|
return _context127.t0.retriableFetchSDK.call(_context127.t0, _context127.t13);
|
|
4613
|
-
case
|
|
4565
|
+
case 30:
|
|
4614
4566
|
resp = _context127.sent;
|
|
4615
4567
|
this._subscriptionService.updateSession(resp);
|
|
4616
4568
|
return _context127.abrupt("return", resp);
|
|
4617
|
-
case
|
|
4569
|
+
case 33:
|
|
4618
4570
|
case "end":
|
|
4619
4571
|
return _context127.stop();
|
|
4620
4572
|
}
|