@stytch/vanilla-js 5.22.3 → 5.22.4
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 +8 -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 +3 -2
- package/dist/b2b/index.js +3 -2
- package/dist/{extractErrorMessage-CceNQdlW.js → extractErrorMessage-B_b8zyEs.js} +1 -1
- package/dist/{extractErrorMessage-CafCL2m8.js → extractErrorMessage-CV4jfIZF.js} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.headless.esm.js +42 -41
- package/dist/index.headless.js +42 -40
- package/dist/index.js +1 -1
- package/dist/{internal-az9hLwxx.js → internal-67Oevzu4.js} +46 -44
- package/dist/{internal-5q6em7Zx.js → internal-BtI2_suI.js} +46 -45
- package/package.json +2 -2
|
@@ -661,12 +661,20 @@ var InvalidPrivateKeyLength = /*#__PURE__*/function (_StytchSDKError35) {
|
|
|
661
661
|
_inherits$1(InvalidPrivateKeyLength, _StytchSDKError35);
|
|
662
662
|
return _createClass$1(InvalidPrivateKeyLength);
|
|
663
663
|
}(StytchSDKError);
|
|
664
|
-
var
|
|
664
|
+
var BiometricRegistrationIdIsNullOrBlank = /*#__PURE__*/function (_StytchSDKError36) {
|
|
665
|
+
function BiometricRegistrationIdIsNullOrBlank() {
|
|
666
|
+
_classCallCheck$1(this, BiometricRegistrationIdIsNullOrBlank);
|
|
667
|
+
return _callSuper$1(this, BiometricRegistrationIdIsNullOrBlank, ['BiometricRegistrationIdIsNullOrBlank', 'Attempted to set a blank or null biometric registration ID. This is not allowed, and indicates no registration was created on the server. Consider deleting any local keys that may have been generated.']);
|
|
668
|
+
}
|
|
669
|
+
_inherits$1(BiometricRegistrationIdIsNullOrBlank, _StytchSDKError36);
|
|
670
|
+
return _createClass$1(BiometricRegistrationIdIsNullOrBlank);
|
|
671
|
+
}(StytchSDKError);
|
|
672
|
+
var IDPOAuthFlowMissingParamError = /*#__PURE__*/function (_StytchSDKError37) {
|
|
665
673
|
function IDPOAuthFlowMissingParamError(details) {
|
|
666
674
|
_classCallCheck$1(this, IDPOAuthFlowMissingParamError);
|
|
667
675
|
return _callSuper$1(this, IDPOAuthFlowMissingParamError, ['IDPOAuthFlowMissingParamError', details]);
|
|
668
676
|
}
|
|
669
|
-
_inherits$1(IDPOAuthFlowMissingParamError,
|
|
677
|
+
_inherits$1(IDPOAuthFlowMissingParamError, _StytchSDKError37);
|
|
670
678
|
return _createClass$1(IDPOAuthFlowMissingParamError);
|
|
671
679
|
}(StytchSDKError);
|
|
672
680
|
function errorToStytchError(error) {
|
|
@@ -747,6 +755,8 @@ function errorToStytchError(error) {
|
|
|
747
755
|
return new MissingCipherIv();
|
|
748
756
|
case 'invalid_private_key_length':
|
|
749
757
|
return new InvalidPrivateKeyLength();
|
|
758
|
+
case 'biometric_registration_id_is_null_or_blank':
|
|
759
|
+
return new BiometricRegistrationIdIsNullOrBlank();
|
|
750
760
|
default:
|
|
751
761
|
return new InternalError(error);
|
|
752
762
|
}
|
|
@@ -2092,15 +2102,6 @@ var ErrorMarshaller = /*#__PURE__*/function () {
|
|
|
2092
2102
|
_classCallCheck(this, ErrorMarshaller);
|
|
2093
2103
|
}
|
|
2094
2104
|
return _createClass(ErrorMarshaller, null, [{
|
|
2095
|
-
key: "marshall",
|
|
2096
|
-
value: function marshall(error) {
|
|
2097
|
-
return Object.assign(Object.assign({}, error), {
|
|
2098
|
-
name: error.name,
|
|
2099
|
-
message: error.message,
|
|
2100
|
-
stack: error.stack
|
|
2101
|
-
});
|
|
2102
|
-
}
|
|
2103
|
-
}, {
|
|
2104
2105
|
key: "inflate",
|
|
2105
2106
|
value: function inflate(ErrorClass, ErrorData) {
|
|
2106
2107
|
var err = new ErrorClass(ErrorData);
|
|
@@ -4368,11 +4369,11 @@ var SearchDataManager = /*#__PURE__*/function () {
|
|
|
4368
4369
|
return _createClass(SearchDataManager, [{
|
|
4369
4370
|
key: "searchUser",
|
|
4370
4371
|
value: function searchUser(email) {
|
|
4371
|
-
var
|
|
4372
|
+
var _this29 = this;
|
|
4372
4373
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha().then(function (_ref10) {
|
|
4373
4374
|
var dfp_telemetry_id = _ref10.dfp_telemetry_id,
|
|
4374
4375
|
captcha_token = _ref10.captcha_token;
|
|
4375
|
-
return
|
|
4376
|
+
return _this29._networkClient.fetchSDK({
|
|
4376
4377
|
url: "/users/search",
|
|
4377
4378
|
method: 'POST',
|
|
4378
4379
|
body: {
|
|
@@ -4431,53 +4432,53 @@ var SessionManagerRegistry = /*#__PURE__*/function () {
|
|
|
4431
4432
|
}();
|
|
4432
4433
|
var SessionManager = /*#__PURE__*/function () {
|
|
4433
4434
|
function SessionManager(_subscriptionService, _headlessSessionClient, _publicToken) {
|
|
4434
|
-
var
|
|
4435
|
+
var _this30 = this;
|
|
4435
4436
|
_classCallCheck(this, SessionManager);
|
|
4436
4437
|
this._subscriptionService = _subscriptionService;
|
|
4437
4438
|
this._headlessSessionClient = _headlessSessionClient;
|
|
4438
4439
|
this._publicToken = _publicToken;
|
|
4439
4440
|
this._onDataChange = function (state) {
|
|
4440
4441
|
if (shouldTryRefresh(state)) {
|
|
4441
|
-
|
|
4442
|
+
_this30.scheduleBackgroundRefresh();
|
|
4442
4443
|
} else {
|
|
4443
|
-
|
|
4444
|
+
_this30.cancelBackgroundRefresh();
|
|
4444
4445
|
}
|
|
4445
4446
|
};
|
|
4446
4447
|
this._reauthenticateWithBackoff = function () {
|
|
4447
|
-
return __awaiter$1(
|
|
4448
|
+
return __awaiter$1(_this30, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee146() {
|
|
4448
4449
|
var count;
|
|
4449
|
-
return _regeneratorRuntime().wrap(function
|
|
4450
|
-
while (1) switch (
|
|
4450
|
+
return _regeneratorRuntime().wrap(function _callee146$(_context146) {
|
|
4451
|
+
while (1) switch (_context146.prev = _context146.next) {
|
|
4451
4452
|
case 0:
|
|
4452
4453
|
count = 0;
|
|
4453
4454
|
case 1:
|
|
4454
|
-
|
|
4455
|
-
|
|
4455
|
+
_context146.prev = 2;
|
|
4456
|
+
_context146.next = 5;
|
|
4456
4457
|
return this._headlessSessionClient.authenticate();
|
|
4457
4458
|
case 5:
|
|
4458
|
-
return
|
|
4459
|
+
return _context146.abrupt("return", _context146.sent);
|
|
4459
4460
|
case 8:
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
if (!SessionManager.isUnrecoverableError(
|
|
4463
|
-
|
|
4461
|
+
_context146.prev = 8;
|
|
4462
|
+
_context146.t0 = _context146["catch"](2);
|
|
4463
|
+
if (!SessionManager.isUnrecoverableError(_context146.t0)) {
|
|
4464
|
+
_context146.next = 12;
|
|
4464
4465
|
break;
|
|
4465
4466
|
}
|
|
4466
|
-
return
|
|
4467
|
+
return _context146.abrupt("return", Promise.reject(_context146.t0));
|
|
4467
4468
|
case 12:
|
|
4468
4469
|
count++;
|
|
4469
|
-
|
|
4470
|
+
_context146.next = 15;
|
|
4470
4471
|
return new Promise(function (done) {
|
|
4471
4472
|
return setTimeout(done, SessionManager.timeoutForAttempt(count));
|
|
4472
4473
|
});
|
|
4473
4474
|
case 15:
|
|
4474
|
-
|
|
4475
|
+
_context146.next = 1;
|
|
4475
4476
|
break;
|
|
4476
4477
|
case 17:
|
|
4477
4478
|
case "end":
|
|
4478
|
-
return
|
|
4479
|
+
return _context146.stop();
|
|
4479
4480
|
}
|
|
4480
|
-
},
|
|
4481
|
+
}, _callee146, this, [[2, 8]]);
|
|
4481
4482
|
}));
|
|
4482
4483
|
};
|
|
4483
4484
|
this.timeout = null;
|
|
@@ -4496,24 +4497,24 @@ var SessionManager = /*#__PURE__*/function () {
|
|
|
4496
4497
|
}, {
|
|
4497
4498
|
key: "performBackgroundRefresh",
|
|
4498
4499
|
value: function performBackgroundRefresh() {
|
|
4499
|
-
var
|
|
4500
|
+
var _this31 = this;
|
|
4500
4501
|
this._reauthenticateWithBackoff().then(function () {
|
|
4501
|
-
|
|
4502
|
+
_this31.scheduleBackgroundRefresh();
|
|
4502
4503
|
})["catch"](function (error) {
|
|
4503
4504
|
logger.warn('Session background refresh failed. Signalling to app that user is logged out.', {
|
|
4504
4505
|
error: error
|
|
4505
4506
|
});
|
|
4506
|
-
|
|
4507
|
+
_this31._subscriptionService.destroySession();
|
|
4507
4508
|
});
|
|
4508
4509
|
}
|
|
4509
4510
|
}, {
|
|
4510
4511
|
key: "scheduleBackgroundRefresh",
|
|
4511
4512
|
value: function scheduleBackgroundRefresh() {
|
|
4512
|
-
var
|
|
4513
|
+
var _this32 = this;
|
|
4513
4514
|
this.cancelBackgroundRefresh();
|
|
4514
4515
|
this.register();
|
|
4515
4516
|
this.timeout = setTimeout(function () {
|
|
4516
|
-
|
|
4517
|
+
_this32.performBackgroundRefresh();
|
|
4517
4518
|
}, SessionManager.REFRESH_INTERVAL_MS);
|
|
4518
4519
|
}
|
|
4519
4520
|
}, {
|
|
@@ -4543,13 +4544,13 @@ var SessionManager = /*#__PURE__*/function () {
|
|
|
4543
4544
|
SessionManager.REFRESH_INTERVAL_MS = 1000 * 60 * 3;
|
|
4544
4545
|
SessionManager.registry = new SessionManagerRegistry();
|
|
4545
4546
|
var StateChangeClient = /*#__PURE__*/_createClass(function StateChangeClient(_subscriptionService, emptyState) {
|
|
4546
|
-
var
|
|
4547
|
+
var _this33 = this;
|
|
4547
4548
|
_classCallCheck(this, StateChangeClient);
|
|
4548
4549
|
this._subscriptionService = _subscriptionService;
|
|
4549
4550
|
this.emptyState = emptyState;
|
|
4550
4551
|
this.onStateChange = function (callback) {
|
|
4551
|
-
return
|
|
4552
|
-
callback(state !== null && state !== void 0 ? state :
|
|
4552
|
+
return _this33._subscriptionService.subscribeToState(function (state) {
|
|
4553
|
+
callback(state !== null && state !== void 0 ? state : _this33.emptyState);
|
|
4553
4554
|
});
|
|
4554
4555
|
};
|
|
4555
4556
|
});
|
|
@@ -4827,7 +4828,7 @@ var HeadlessOAuthClient = /*#__PURE__*/function (_HeadlessOAuthClient$) {
|
|
|
4827
4828
|
_inherits2(HeadlessOAuthClient, _HeadlessOAuthClient$);
|
|
4828
4829
|
return _createClass2(HeadlessOAuthClient);
|
|
4829
4830
|
}(HeadlessOAuthClient$1);
|
|
4830
|
-
var version = "5.22.
|
|
4831
|
+
var version = "5.22.4";
|
|
4831
4832
|
var NetworkClient = /*#__PURE__*/function () {
|
|
4832
4833
|
function NetworkClient(_publicToken, _subscriptionDataLayer, _liveAPIURL, _testAPIURL, additionalTelemetryDataFn) {
|
|
4833
4834
|
_classCallCheck2(this, NetworkClient);
|
|
@@ -6130,4 +6131,4 @@ var StytchHeadlessClient = /*#__PURE__*/_createClass2(function StytchHeadlessCli
|
|
|
6130
6131
|
networkClient: this._networkClient
|
|
6131
6132
|
});
|
|
6132
6133
|
});
|
|
6133
|
-
export { AuthFlowType, B2BMFAProducts, B2BOAuthProviders, B2BProducts, BiometricsAlreadyEnrolledError, BiometricsFailedError, BiometricsUnavailableError, ChallengeSigningFailedError, DeviceCredentialsNotAllowedError, FailedCodeChallengeError, FailedToDecryptDataError, IDPOAuthFlowMissingParamError, InternalError, InvalidAuthorizationCredentialError, InvalidCredentialTypeError, InvalidPrivateKeyLength, InvalidRedirectSchemeError, InvalidStartUrlError, JSONDataNotConvertibleToStringError, KeyInvalidatedError, KeystoreUnavailableError, MissingAttestationObjectError, MissingAuthorizationCredentialIDTokenError, MissingCipherIv, MissingGoogleClientIDError, MissingPKCEError, MissingPublicKeyError, MissingUrlError, NoBiometricsEnrolledError, NoBiometricsRegistrationError, NoCredentialsPresentError, NoCurrentSessionError, OAuthProviders, OTPMethods, OneTapPositions, PasskeysInvalidEncoding, PasskeysMisconfigured, PasskeysUnsupportedError, Products, RNUIProducts, RandomNumberGenerationFailed, RedirectURLType, SDKAPIUnreachableError, SDKNotConfiguredError, SignInWithAppleMisconfigured, StytchAPIError, StytchAPISchemaError, StytchAPIUnreachableError, StytchError, StytchEventType, StytchHeadlessClient, StytchSDKAPIError, StytchSDKError, StytchSDKSchemaError, StytchSDKUsageError, UNRECOVERABLE_ERROR_TYPES, UserCancellationError, UserLockedOutError, Wallets, errorToStytchError };
|
|
6134
|
+
export { AuthFlowType, B2BMFAProducts, B2BOAuthProviders, B2BProducts, BiometricRegistrationIdIsNullOrBlank, BiometricsAlreadyEnrolledError, BiometricsFailedError, BiometricsUnavailableError, ChallengeSigningFailedError, DeviceCredentialsNotAllowedError, FailedCodeChallengeError, FailedToDecryptDataError, IDPOAuthFlowMissingParamError, InternalError, InvalidAuthorizationCredentialError, InvalidCredentialTypeError, InvalidPrivateKeyLength, InvalidRedirectSchemeError, InvalidStartUrlError, JSONDataNotConvertibleToStringError, KeyInvalidatedError, KeystoreUnavailableError, MissingAttestationObjectError, MissingAuthorizationCredentialIDTokenError, MissingCipherIv, MissingGoogleClientIDError, MissingPKCEError, MissingPublicKeyError, MissingUrlError, NoBiometricsEnrolledError, NoBiometricsRegistrationError, NoCredentialsPresentError, NoCurrentSessionError, OAuthProviders, OTPMethods, OneTapPositions, PasskeysInvalidEncoding, PasskeysMisconfigured, PasskeysUnsupportedError, Products, RNUIProducts, RandomNumberGenerationFailed, RedirectURLType, SDKAPIUnreachableError, SDKNotConfiguredError, SignInWithAppleMisconfigured, StytchAPIError, StytchAPISchemaError, StytchAPIUnreachableError, StytchError, StytchEventType, StytchHeadlessClient, StytchSDKAPIError, StytchSDKError, StytchSDKSchemaError, StytchSDKUsageError, UNRECOVERABLE_ERROR_TYPES, UserCancellationError, UserLockedOutError, Wallets, errorToStytchError };
|
package/dist/index.headless.js
CHANGED
|
@@ -663,12 +663,20 @@ var InvalidPrivateKeyLength = /*#__PURE__*/function (_StytchSDKError35) {
|
|
|
663
663
|
_inherits$1(InvalidPrivateKeyLength, _StytchSDKError35);
|
|
664
664
|
return _createClass$1(InvalidPrivateKeyLength);
|
|
665
665
|
}(StytchSDKError);
|
|
666
|
-
var
|
|
666
|
+
var BiometricRegistrationIdIsNullOrBlank = /*#__PURE__*/function (_StytchSDKError36) {
|
|
667
|
+
function BiometricRegistrationIdIsNullOrBlank() {
|
|
668
|
+
_classCallCheck$1(this, BiometricRegistrationIdIsNullOrBlank);
|
|
669
|
+
return _callSuper$1(this, BiometricRegistrationIdIsNullOrBlank, ['BiometricRegistrationIdIsNullOrBlank', 'Attempted to set a blank or null biometric registration ID. This is not allowed, and indicates no registration was created on the server. Consider deleting any local keys that may have been generated.']);
|
|
670
|
+
}
|
|
671
|
+
_inherits$1(BiometricRegistrationIdIsNullOrBlank, _StytchSDKError36);
|
|
672
|
+
return _createClass$1(BiometricRegistrationIdIsNullOrBlank);
|
|
673
|
+
}(StytchSDKError);
|
|
674
|
+
var IDPOAuthFlowMissingParamError = /*#__PURE__*/function (_StytchSDKError37) {
|
|
667
675
|
function IDPOAuthFlowMissingParamError(details) {
|
|
668
676
|
_classCallCheck$1(this, IDPOAuthFlowMissingParamError);
|
|
669
677
|
return _callSuper$1(this, IDPOAuthFlowMissingParamError, ['IDPOAuthFlowMissingParamError', details]);
|
|
670
678
|
}
|
|
671
|
-
_inherits$1(IDPOAuthFlowMissingParamError,
|
|
679
|
+
_inherits$1(IDPOAuthFlowMissingParamError, _StytchSDKError37);
|
|
672
680
|
return _createClass$1(IDPOAuthFlowMissingParamError);
|
|
673
681
|
}(StytchSDKError);
|
|
674
682
|
function errorToStytchError(error) {
|
|
@@ -749,6 +757,8 @@ function errorToStytchError(error) {
|
|
|
749
757
|
return new MissingCipherIv();
|
|
750
758
|
case 'invalid_private_key_length':
|
|
751
759
|
return new InvalidPrivateKeyLength();
|
|
760
|
+
case 'biometric_registration_id_is_null_or_blank':
|
|
761
|
+
return new BiometricRegistrationIdIsNullOrBlank();
|
|
752
762
|
default:
|
|
753
763
|
return new InternalError(error);
|
|
754
764
|
}
|
|
@@ -2094,15 +2104,6 @@ var ErrorMarshaller = /*#__PURE__*/function () {
|
|
|
2094
2104
|
_classCallCheck(this, ErrorMarshaller);
|
|
2095
2105
|
}
|
|
2096
2106
|
return _createClass(ErrorMarshaller, null, [{
|
|
2097
|
-
key: "marshall",
|
|
2098
|
-
value: function marshall(error) {
|
|
2099
|
-
return Object.assign(Object.assign({}, error), {
|
|
2100
|
-
name: error.name,
|
|
2101
|
-
message: error.message,
|
|
2102
|
-
stack: error.stack
|
|
2103
|
-
});
|
|
2104
|
-
}
|
|
2105
|
-
}, {
|
|
2106
2107
|
key: "inflate",
|
|
2107
2108
|
value: function inflate(ErrorClass, ErrorData) {
|
|
2108
2109
|
var err = new ErrorClass(ErrorData);
|
|
@@ -4370,11 +4371,11 @@ var SearchDataManager = /*#__PURE__*/function () {
|
|
|
4370
4371
|
return _createClass(SearchDataManager, [{
|
|
4371
4372
|
key: "searchUser",
|
|
4372
4373
|
value: function searchUser(email) {
|
|
4373
|
-
var
|
|
4374
|
+
var _this29 = this;
|
|
4374
4375
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha().then(function (_ref10) {
|
|
4375
4376
|
var dfp_telemetry_id = _ref10.dfp_telemetry_id,
|
|
4376
4377
|
captcha_token = _ref10.captcha_token;
|
|
4377
|
-
return
|
|
4378
|
+
return _this29._networkClient.fetchSDK({
|
|
4378
4379
|
url: "/users/search",
|
|
4379
4380
|
method: 'POST',
|
|
4380
4381
|
body: {
|
|
@@ -4433,53 +4434,53 @@ var SessionManagerRegistry = /*#__PURE__*/function () {
|
|
|
4433
4434
|
}();
|
|
4434
4435
|
var SessionManager = /*#__PURE__*/function () {
|
|
4435
4436
|
function SessionManager(_subscriptionService, _headlessSessionClient, _publicToken) {
|
|
4436
|
-
var
|
|
4437
|
+
var _this30 = this;
|
|
4437
4438
|
_classCallCheck(this, SessionManager);
|
|
4438
4439
|
this._subscriptionService = _subscriptionService;
|
|
4439
4440
|
this._headlessSessionClient = _headlessSessionClient;
|
|
4440
4441
|
this._publicToken = _publicToken;
|
|
4441
4442
|
this._onDataChange = function (state) {
|
|
4442
4443
|
if (shouldTryRefresh(state)) {
|
|
4443
|
-
|
|
4444
|
+
_this30.scheduleBackgroundRefresh();
|
|
4444
4445
|
} else {
|
|
4445
|
-
|
|
4446
|
+
_this30.cancelBackgroundRefresh();
|
|
4446
4447
|
}
|
|
4447
4448
|
};
|
|
4448
4449
|
this._reauthenticateWithBackoff = function () {
|
|
4449
|
-
return __awaiter$1(
|
|
4450
|
+
return __awaiter$1(_this30, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee146() {
|
|
4450
4451
|
var count;
|
|
4451
|
-
return _regeneratorRuntime().wrap(function
|
|
4452
|
-
while (1) switch (
|
|
4452
|
+
return _regeneratorRuntime().wrap(function _callee146$(_context146) {
|
|
4453
|
+
while (1) switch (_context146.prev = _context146.next) {
|
|
4453
4454
|
case 0:
|
|
4454
4455
|
count = 0;
|
|
4455
4456
|
case 1:
|
|
4456
|
-
|
|
4457
|
-
|
|
4457
|
+
_context146.prev = 2;
|
|
4458
|
+
_context146.next = 5;
|
|
4458
4459
|
return this._headlessSessionClient.authenticate();
|
|
4459
4460
|
case 5:
|
|
4460
|
-
return
|
|
4461
|
+
return _context146.abrupt("return", _context146.sent);
|
|
4461
4462
|
case 8:
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
if (!SessionManager.isUnrecoverableError(
|
|
4465
|
-
|
|
4463
|
+
_context146.prev = 8;
|
|
4464
|
+
_context146.t0 = _context146["catch"](2);
|
|
4465
|
+
if (!SessionManager.isUnrecoverableError(_context146.t0)) {
|
|
4466
|
+
_context146.next = 12;
|
|
4466
4467
|
break;
|
|
4467
4468
|
}
|
|
4468
|
-
return
|
|
4469
|
+
return _context146.abrupt("return", Promise.reject(_context146.t0));
|
|
4469
4470
|
case 12:
|
|
4470
4471
|
count++;
|
|
4471
|
-
|
|
4472
|
+
_context146.next = 15;
|
|
4472
4473
|
return new Promise(function (done) {
|
|
4473
4474
|
return setTimeout(done, SessionManager.timeoutForAttempt(count));
|
|
4474
4475
|
});
|
|
4475
4476
|
case 15:
|
|
4476
|
-
|
|
4477
|
+
_context146.next = 1;
|
|
4477
4478
|
break;
|
|
4478
4479
|
case 17:
|
|
4479
4480
|
case "end":
|
|
4480
|
-
return
|
|
4481
|
+
return _context146.stop();
|
|
4481
4482
|
}
|
|
4482
|
-
},
|
|
4483
|
+
}, _callee146, this, [[2, 8]]);
|
|
4483
4484
|
}));
|
|
4484
4485
|
};
|
|
4485
4486
|
this.timeout = null;
|
|
@@ -4498,24 +4499,24 @@ var SessionManager = /*#__PURE__*/function () {
|
|
|
4498
4499
|
}, {
|
|
4499
4500
|
key: "performBackgroundRefresh",
|
|
4500
4501
|
value: function performBackgroundRefresh() {
|
|
4501
|
-
var
|
|
4502
|
+
var _this31 = this;
|
|
4502
4503
|
this._reauthenticateWithBackoff().then(function () {
|
|
4503
|
-
|
|
4504
|
+
_this31.scheduleBackgroundRefresh();
|
|
4504
4505
|
})["catch"](function (error) {
|
|
4505
4506
|
logger.warn('Session background refresh failed. Signalling to app that user is logged out.', {
|
|
4506
4507
|
error: error
|
|
4507
4508
|
});
|
|
4508
|
-
|
|
4509
|
+
_this31._subscriptionService.destroySession();
|
|
4509
4510
|
});
|
|
4510
4511
|
}
|
|
4511
4512
|
}, {
|
|
4512
4513
|
key: "scheduleBackgroundRefresh",
|
|
4513
4514
|
value: function scheduleBackgroundRefresh() {
|
|
4514
|
-
var
|
|
4515
|
+
var _this32 = this;
|
|
4515
4516
|
this.cancelBackgroundRefresh();
|
|
4516
4517
|
this.register();
|
|
4517
4518
|
this.timeout = setTimeout(function () {
|
|
4518
|
-
|
|
4519
|
+
_this32.performBackgroundRefresh();
|
|
4519
4520
|
}, SessionManager.REFRESH_INTERVAL_MS);
|
|
4520
4521
|
}
|
|
4521
4522
|
}, {
|
|
@@ -4545,13 +4546,13 @@ var SessionManager = /*#__PURE__*/function () {
|
|
|
4545
4546
|
SessionManager.REFRESH_INTERVAL_MS = 1000 * 60 * 3;
|
|
4546
4547
|
SessionManager.registry = new SessionManagerRegistry();
|
|
4547
4548
|
var StateChangeClient = /*#__PURE__*/_createClass(function StateChangeClient(_subscriptionService, emptyState) {
|
|
4548
|
-
var
|
|
4549
|
+
var _this33 = this;
|
|
4549
4550
|
_classCallCheck(this, StateChangeClient);
|
|
4550
4551
|
this._subscriptionService = _subscriptionService;
|
|
4551
4552
|
this.emptyState = emptyState;
|
|
4552
4553
|
this.onStateChange = function (callback) {
|
|
4553
|
-
return
|
|
4554
|
-
callback(state !== null && state !== void 0 ? state :
|
|
4554
|
+
return _this33._subscriptionService.subscribeToState(function (state) {
|
|
4555
|
+
callback(state !== null && state !== void 0 ? state : _this33.emptyState);
|
|
4555
4556
|
});
|
|
4556
4557
|
};
|
|
4557
4558
|
});
|
|
@@ -4829,7 +4830,7 @@ var HeadlessOAuthClient = /*#__PURE__*/function (_HeadlessOAuthClient$) {
|
|
|
4829
4830
|
_inherits2(HeadlessOAuthClient, _HeadlessOAuthClient$);
|
|
4830
4831
|
return _createClass2(HeadlessOAuthClient);
|
|
4831
4832
|
}(HeadlessOAuthClient$1);
|
|
4832
|
-
var version = "5.22.
|
|
4833
|
+
var version = "5.22.4";
|
|
4833
4834
|
var NetworkClient = /*#__PURE__*/function () {
|
|
4834
4835
|
function NetworkClient(_publicToken, _subscriptionDataLayer, _liveAPIURL, _testAPIURL, additionalTelemetryDataFn) {
|
|
4835
4836
|
_classCallCheck2(this, NetworkClient);
|
|
@@ -6132,6 +6133,7 @@ var StytchHeadlessClient = /*#__PURE__*/_createClass2(function StytchHeadlessCli
|
|
|
6132
6133
|
networkClient: this._networkClient
|
|
6133
6134
|
});
|
|
6134
6135
|
});
|
|
6136
|
+
exports.BiometricRegistrationIdIsNullOrBlank = BiometricRegistrationIdIsNullOrBlank;
|
|
6135
6137
|
exports.BiometricsAlreadyEnrolledError = BiometricsAlreadyEnrolledError;
|
|
6136
6138
|
exports.BiometricsFailedError = BiometricsFailedError;
|
|
6137
6139
|
exports.BiometricsUnavailableError = BiometricsUnavailableError;
|