@okta/okta-auth-js 5.9.0 → 5.11.0
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 +30 -0
- package/README.md +12 -2
- package/cjs/OktaAuth.js +25 -12
- package/cjs/OktaAuth.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/OktaUserAgent.js.map +1 -1
- package/cjs/TokenManager.js +24 -2
- package/cjs/TokenManager.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js +14 -0
- package/cjs/idx/authenticator/Authenticator.js.map +1 -0
- package/cjs/idx/authenticator/OktaPassword.js +31 -0
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js +17 -0
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +50 -0
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +31 -0
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +34 -0
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/getAuthenticator.js +42 -0
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -0
- package/cjs/idx/authenticator/index.js +80 -0
- package/cjs/idx/authenticator/index.js.map +1 -0
- package/cjs/idx/cancel.js +5 -0
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/flow/AuthenticationFlow.js +4 -1
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/flow/FlowSpecification.js +1 -11
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/RegistrationFlow.js +1 -0
- package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
- package/cjs/idx/flow/index.js +0 -52
- package/cjs/idx/flow/index.js.map +1 -1
- package/cjs/idx/index.js +13 -0
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js +8 -2
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/poll.js +59 -0
- package/cjs/idx/poll.js.map +1 -0
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/register.js +14 -3
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +37 -90
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +9 -12
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +6 -9
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +43 -32
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +51 -20
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +16 -16
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +8 -28
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/{lib/idx/flow/FlowMonitor.d.ts → cjs/idx/remediators/ChallengePoll.js} +16 -13
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -0
- package/cjs/idx/remediators/EnrollPoll.js +56 -0
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -0
- package/cjs/idx/remediators/Identify.js +2 -35
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +23 -2
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/Skip.js +7 -0
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js +26 -0
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/run.js +0 -8
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +2 -1
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/types/Token.js.map +1 -1
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.umd.js +1 -1
- package/dist/okta-auth-js.umd.js.map +1 -1
- package/esm/index.js +1410 -1197
- package/esm/index.js.map +1 -1
- package/lib/TokenManager.d.ts +2 -0
- package/lib/idx/authenticator/Authenticator.d.ts +12 -0
- package/lib/idx/authenticator/OktaPassword.d.ts +11 -0
- package/lib/idx/authenticator/OktaVerifyTotp.d.ts +9 -0
- package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +28 -0
- package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +14 -0
- package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +10 -0
- package/lib/idx/authenticator/getAuthenticator.d.ts +3 -0
- package/lib/idx/authenticator/index.d.ts +6 -0
- package/lib/idx/flow/FlowSpecification.d.ts +0 -2
- package/lib/idx/flow/index.d.ts +0 -4
- package/lib/idx/index.d.ts +1 -0
- package/lib/idx/interact.d.ts +1 -0
- package/lib/idx/{flow/AuthenticationFlowMonitor.d.ts → poll.d.ts} +3 -5
- package/lib/idx/proceed.d.ts +2 -1
- package/lib/idx/register.d.ts +1 -1
- package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +9 -5
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +0 -1
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +8 -3
- package/lib/idx/remediators/Base/Remediator.d.ts +9 -6
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +5 -4
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +8 -4
- package/lib/idx/{flow/RegistrationFlowMonitor.d.ts → remediators/ChallengePoll.d.ts} +3 -3
- package/lib/idx/{flow/PasswordRecoveryFlowMonitor.d.ts → remediators/EnrollPoll.d.ts} +12 -4
- package/lib/idx/remediators/Identify.d.ts +0 -3
- package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +6 -2
- package/lib/idx/remediators/Skip.d.ts +3 -0
- package/lib/idx/remediators/index.d.ts +2 -0
- package/lib/idx/run.d.ts +1 -2
- package/lib/idx/types/idx-js.d.ts +49 -1
- package/lib/idx/types/index.d.ts +8 -2
- package/lib/types/OktaAuthOptions.d.ts +1 -0
- package/lib/types/Token.d.ts +1 -0
- package/lib/types/api.d.ts +4 -2
- package/package.json +6 -9
- package/cjs/idx/flow/AuthenticationFlowMonitor.js +0 -45
- package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +0 -1
- package/cjs/idx/flow/FlowMonitor.js +0 -69
- package/cjs/idx/flow/FlowMonitor.js.map +0 -1
- package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js +0 -55
- package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +0 -1
- package/cjs/idx/flow/RegistrationFlowMonitor.js +0 -35
- package/cjs/idx/flow/RegistrationFlowMonitor.js.map +0 -1
package/esm/index.js
CHANGED
|
@@ -24,17 +24,17 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
24
24
|
import crossFetch from 'cross-fetch';
|
|
25
25
|
import idx from '@okta/okta-idx-js';
|
|
26
26
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
27
|
-
import _get from '@babel/runtime/helpers/get';
|
|
28
27
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
28
|
+
import _get from '@babel/runtime/helpers/get';
|
|
29
29
|
|
|
30
|
-
function _createSuper$
|
|
30
|
+
function _createSuper$r(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$r(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
31
|
|
|
32
|
-
function _isNativeReflectConstruct$
|
|
32
|
+
function _isNativeReflectConstruct$r() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
33
33
|
|
|
34
34
|
var CustomError = /*#__PURE__*/function (_Error) {
|
|
35
35
|
_inherits(CustomError, _Error);
|
|
36
36
|
|
|
37
|
-
var _super = _createSuper$
|
|
37
|
+
var _super = _createSuper$r(CustomError);
|
|
38
38
|
|
|
39
39
|
function CustomError(message) {
|
|
40
40
|
var _this;
|
|
@@ -49,14 +49,14 @@ var CustomError = /*#__PURE__*/function (_Error) {
|
|
|
49
49
|
return CustomError;
|
|
50
50
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
51
51
|
|
|
52
|
-
function _createSuper$
|
|
52
|
+
function _createSuper$q(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$q(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
53
53
|
|
|
54
|
-
function _isNativeReflectConstruct$
|
|
54
|
+
function _isNativeReflectConstruct$q() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
55
55
|
|
|
56
56
|
var AuthApiError = /*#__PURE__*/function (_CustomError) {
|
|
57
57
|
_inherits(AuthApiError, _CustomError);
|
|
58
58
|
|
|
59
|
-
var _super = _createSuper$
|
|
59
|
+
var _super = _createSuper$q(AuthApiError);
|
|
60
60
|
|
|
61
61
|
function AuthApiError(err, xhr) {
|
|
62
62
|
var _this;
|
|
@@ -82,14 +82,14 @@ var AuthApiError = /*#__PURE__*/function (_CustomError) {
|
|
|
82
82
|
return AuthApiError;
|
|
83
83
|
}(CustomError);
|
|
84
84
|
|
|
85
|
-
function _createSuper$
|
|
85
|
+
function _createSuper$p(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$p(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
86
86
|
|
|
87
|
-
function _isNativeReflectConstruct$
|
|
87
|
+
function _isNativeReflectConstruct$p() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
88
88
|
|
|
89
89
|
var AuthPollStopError = /*#__PURE__*/function (_CustomError) {
|
|
90
90
|
_inherits(AuthPollStopError, _CustomError);
|
|
91
91
|
|
|
92
|
-
var _super = _createSuper$
|
|
92
|
+
var _super = _createSuper$p(AuthPollStopError);
|
|
93
93
|
|
|
94
94
|
function AuthPollStopError() {
|
|
95
95
|
_classCallCheck(this, AuthPollStopError);
|
|
@@ -101,14 +101,14 @@ var AuthPollStopError = /*#__PURE__*/function (_CustomError) {
|
|
|
101
101
|
return AuthPollStopError;
|
|
102
102
|
}(CustomError);
|
|
103
103
|
|
|
104
|
-
function _createSuper$
|
|
104
|
+
function _createSuper$o(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$o(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
105
105
|
|
|
106
|
-
function _isNativeReflectConstruct$
|
|
106
|
+
function _isNativeReflectConstruct$o() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
107
107
|
|
|
108
108
|
var AuthSdkError = /*#__PURE__*/function (_CustomError) {
|
|
109
109
|
_inherits(AuthSdkError, _CustomError);
|
|
110
110
|
|
|
111
|
-
var _super = _createSuper$
|
|
111
|
+
var _super = _createSuper$o(AuthSdkError);
|
|
112
112
|
|
|
113
113
|
function AuthSdkError(msg, xhr) {
|
|
114
114
|
var _this;
|
|
@@ -133,14 +133,14 @@ var AuthSdkError = /*#__PURE__*/function (_CustomError) {
|
|
|
133
133
|
return AuthSdkError;
|
|
134
134
|
}(CustomError);
|
|
135
135
|
|
|
136
|
-
function _createSuper$
|
|
136
|
+
function _createSuper$n(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$n(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
137
137
|
|
|
138
|
-
function _isNativeReflectConstruct$
|
|
138
|
+
function _isNativeReflectConstruct$n() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
139
139
|
|
|
140
140
|
var OAuthError = /*#__PURE__*/function (_CustomError) {
|
|
141
141
|
_inherits(OAuthError, _CustomError);
|
|
142
142
|
|
|
143
|
-
var _super = _createSuper$
|
|
143
|
+
var _super = _createSuper$n(OAuthError);
|
|
144
144
|
|
|
145
145
|
function OAuthError(errorCode, summary) {
|
|
146
146
|
var _this;
|
|
@@ -1789,9 +1789,10 @@ var AuthenticatorKey;
|
|
|
1789
1789
|
(function (AuthenticatorKey) {
|
|
1790
1790
|
AuthenticatorKey["OKTA_PASSWORD"] = "okta_password";
|
|
1791
1791
|
AuthenticatorKey["OKTA_EMAIL"] = "okta_email";
|
|
1792
|
-
AuthenticatorKey["OKTA_VERIFIER"] = "okta_verifier";
|
|
1793
1792
|
AuthenticatorKey["PHONE_NUMBER"] = "phone_number";
|
|
1794
1793
|
AuthenticatorKey["GOOGLE_AUTHENTICATOR"] = "google_otp";
|
|
1794
|
+
AuthenticatorKey["SECURITY_QUESTION"] = "security_question";
|
|
1795
|
+
AuthenticatorKey["OKTA_VERIFY"] = "okta_verify";
|
|
1795
1796
|
})(AuthenticatorKey || (AuthenticatorKey = {}));
|
|
1796
1797
|
|
|
1797
1798
|
var IdxFeature;
|
|
@@ -3124,6 +3125,7 @@ var TokenService = /*#__PURE__*/function () {
|
|
|
3124
3125
|
var DEFAULT_OPTIONS = {
|
|
3125
3126
|
autoRenew: true,
|
|
3126
3127
|
autoRemove: true,
|
|
3128
|
+
clearPendingRemoveTokens: true,
|
|
3127
3129
|
storage: undefined,
|
|
3128
3130
|
expireEarlySeconds: 30,
|
|
3129
3131
|
storageKey: TOKEN_STORAGE_NAME,
|
|
@@ -3192,6 +3194,10 @@ var TokenManager = /*#__PURE__*/function () {
|
|
|
3192
3194
|
this.stop();
|
|
3193
3195
|
}
|
|
3194
3196
|
|
|
3197
|
+
if (this.options.clearPendingRemoveTokens) {
|
|
3198
|
+
this.clearPendingRemoveTokens();
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3195
3201
|
this.service = new TokenService(this, this.getOptions());
|
|
3196
3202
|
this.service.start();
|
|
3197
3203
|
}
|
|
@@ -3584,11 +3590,11 @@ var TokenManager = /*#__PURE__*/function () {
|
|
|
3584
3590
|
}).catch(function (err) {
|
|
3585
3591
|
if (isRefreshTokenError(err) || err.name === 'OAuthError' || err.name === 'AuthSdkError') {
|
|
3586
3592
|
_this4.remove(key);
|
|
3593
|
+
}
|
|
3587
3594
|
|
|
3588
|
-
|
|
3595
|
+
err.tokenKey = key;
|
|
3589
3596
|
|
|
3590
|
-
|
|
3591
|
-
}
|
|
3597
|
+
_this4.emitError(err);
|
|
3592
3598
|
|
|
3593
3599
|
throw err;
|
|
3594
3600
|
}).finally(function () {
|
|
@@ -3602,6 +3608,18 @@ var TokenManager = /*#__PURE__*/function () {
|
|
|
3602
3608
|
this.clearExpireEventTimeoutAll();
|
|
3603
3609
|
this.storage.clearStorage();
|
|
3604
3610
|
}
|
|
3611
|
+
}, {
|
|
3612
|
+
key: "clearPendingRemoveTokens",
|
|
3613
|
+
value: function clearPendingRemoveTokens() {
|
|
3614
|
+
var _this5 = this;
|
|
3615
|
+
|
|
3616
|
+
var tokens = this.getTokensSync();
|
|
3617
|
+
Object.keys(tokens).forEach(function (key) {
|
|
3618
|
+
if (tokens[key].pendingRemove) {
|
|
3619
|
+
_this5.remove(key);
|
|
3620
|
+
}
|
|
3621
|
+
});
|
|
3622
|
+
}
|
|
3605
3623
|
}, {
|
|
3606
3624
|
key: "getTokensFromStorageValue",
|
|
3607
3625
|
value: function getTokensFromStorageValue(value) {
|
|
@@ -3626,6 +3644,15 @@ var TokenManager = /*#__PURE__*/function () {
|
|
|
3626
3644
|
tokenStorage[key] = token;
|
|
3627
3645
|
this.storage.setStorage(tokenStorage);
|
|
3628
3646
|
}
|
|
3647
|
+
}, {
|
|
3648
|
+
key: "addPendingRemoveFlags",
|
|
3649
|
+
value: function addPendingRemoveFlags() {
|
|
3650
|
+
var tokens = this.getTokensSync();
|
|
3651
|
+
Object.keys(tokens).forEach(function (key) {
|
|
3652
|
+
tokens[key].pendingRemove = true;
|
|
3653
|
+
});
|
|
3654
|
+
this.setTokens(tokens);
|
|
3655
|
+
}
|
|
3629
3656
|
}]);
|
|
3630
3657
|
|
|
3631
3658
|
return TokenManager;
|
|
@@ -4567,11 +4594,11 @@ var TransactionManager = /*#__PURE__*/function () {
|
|
|
4567
4594
|
return TransactionManager;
|
|
4568
4595
|
}();
|
|
4569
4596
|
|
|
4570
|
-
function _createForOfIteratorHelper$
|
|
4597
|
+
function _createForOfIteratorHelper$4(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4571
4598
|
|
|
4572
|
-
function _unsupportedIterableToArray$
|
|
4599
|
+
function _unsupportedIterableToArray$4(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$4(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen); }
|
|
4573
4600
|
|
|
4574
|
-
function _arrayLikeToArray$
|
|
4601
|
+
function _arrayLikeToArray$4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
4575
4602
|
|
|
4576
4603
|
function readData(response) {
|
|
4577
4604
|
if (response.headers.get('Content-Type') && response.headers.get('Content-Type').toLowerCase().indexOf('application/json') >= 0) {
|
|
@@ -4590,7 +4617,7 @@ function formatResult(status, data, response) {
|
|
|
4590
4617
|
var isObject = _typeof(data) === 'object';
|
|
4591
4618
|
var headers = {};
|
|
4592
4619
|
|
|
4593
|
-
var _iterator = _createForOfIteratorHelper$
|
|
4620
|
+
var _iterator = _createForOfIteratorHelper$4(response.headers.entries()),
|
|
4594
4621
|
_step;
|
|
4595
4622
|
|
|
4596
4623
|
try {
|
|
@@ -5039,6 +5066,7 @@ function _interact() {
|
|
|
5039
5066
|
clientId,
|
|
5040
5067
|
redirectUri,
|
|
5041
5068
|
scopes,
|
|
5069
|
+
activationToken,
|
|
5042
5070
|
baseUrl,
|
|
5043
5071
|
_args = arguments;
|
|
5044
5072
|
|
|
@@ -5068,6 +5096,7 @@ function _interact() {
|
|
|
5068
5096
|
_authClient$options = authClient.options, clientId = _authClient$options.clientId, redirectUri = _authClient$options.redirectUri;
|
|
5069
5097
|
state = state || meta.state;
|
|
5070
5098
|
scopes = options.scopes || authClient.options.scopes || meta.scopes;
|
|
5099
|
+
activationToken = options.activationToken;
|
|
5071
5100
|
baseUrl = getOAuthBaseUrl(authClient);
|
|
5072
5101
|
return _context.abrupt("return", idx.interact({
|
|
5073
5102
|
clientId: clientId,
|
|
@@ -5076,7 +5105,8 @@ function _interact() {
|
|
|
5076
5105
|
state: state,
|
|
5077
5106
|
redirectUri: redirectUri,
|
|
5078
5107
|
codeChallenge: codeChallenge,
|
|
5079
|
-
codeChallengeMethod: codeChallengeMethod
|
|
5108
|
+
codeChallengeMethod: codeChallengeMethod,
|
|
5109
|
+
activationToken: activationToken
|
|
5080
5110
|
}).then(function (interactionHandle) {
|
|
5081
5111
|
var newMeta = Object.assign(Object.assign({}, meta), {
|
|
5082
5112
|
interactionHandle: interactionHandle,
|
|
@@ -5087,7 +5117,7 @@ function _interact() {
|
|
|
5087
5117
|
return getResponse(newMeta);
|
|
5088
5118
|
}));
|
|
5089
5119
|
|
|
5090
|
-
case
|
|
5120
|
+
case 14:
|
|
5091
5121
|
case "end":
|
|
5092
5122
|
return _context.stop();
|
|
5093
5123
|
}
|
|
@@ -5162,496 +5192,162 @@ function _introspect() {
|
|
|
5162
5192
|
return _introspect.apply(this, arguments);
|
|
5163
5193
|
}
|
|
5164
5194
|
|
|
5165
|
-
function
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
function
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
var remediatorCandidates = [];
|
|
5175
|
-
|
|
5176
|
-
var _iterator = _createForOfIteratorHelper$2(idxRemediations),
|
|
5177
|
-
_step;
|
|
5178
|
-
|
|
5179
|
-
try {
|
|
5180
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
5181
|
-
var remediation = _step.value;
|
|
5182
|
-
var isRemeditionInFlow = Object.keys(remediators).includes(remediation.name);
|
|
5183
|
-
|
|
5184
|
-
if (!isRemeditionInFlow) {
|
|
5185
|
-
continue;
|
|
5186
|
-
}
|
|
5187
|
-
|
|
5188
|
-
var T = remediators[remediation.name];
|
|
5189
|
-
remediator = new T(remediation, values);
|
|
5190
|
-
|
|
5191
|
-
if (flowMonitor.isRemediatorCandidate(remediator, idxRemediations, values)) {
|
|
5192
|
-
if (remediator.canRemediate()) {
|
|
5193
|
-
return remediator;
|
|
5194
|
-
}
|
|
5195
|
-
|
|
5196
|
-
remediatorCandidates.push(remediator);
|
|
5197
|
-
}
|
|
5195
|
+
function getAllValues(idxRemediation) {
|
|
5196
|
+
return idxRemediation.value.map(function (r) {
|
|
5197
|
+
return r.name;
|
|
5198
|
+
});
|
|
5199
|
+
}
|
|
5200
|
+
function getRequiredValues(idxRemediation) {
|
|
5201
|
+
return idxRemediation.value.reduce(function (required, cur) {
|
|
5202
|
+
if (cur.required) {
|
|
5203
|
+
required.push(cur.name);
|
|
5198
5204
|
}
|
|
5199
|
-
} catch (err) {
|
|
5200
|
-
_iterator.e(err);
|
|
5201
|
-
} finally {
|
|
5202
|
-
_iterator.f();
|
|
5203
|
-
}
|
|
5204
5205
|
|
|
5205
|
-
|
|
5206
|
+
return required;
|
|
5207
|
+
}, []);
|
|
5206
5208
|
}
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
var neededToProceed = idxResponse.neededToProceed,
|
|
5210
|
-
interactionCode = idxResponse.interactionCode;
|
|
5211
|
-
return !neededToProceed.length && !interactionCode;
|
|
5209
|
+
function titleCase(str) {
|
|
5210
|
+
return str.charAt(0).toUpperCase() + str.substring(1);
|
|
5212
5211
|
}
|
|
5213
|
-
|
|
5214
|
-
function
|
|
5215
|
-
return idxResponse.neededToProceed.some(function (_ref) {
|
|
5212
|
+
function getAuthenticatorFromRemediation(remediation) {
|
|
5213
|
+
return remediation.value.find(function (_ref) {
|
|
5216
5214
|
var name = _ref.name;
|
|
5217
|
-
return name === '
|
|
5218
|
-
});
|
|
5219
|
-
}
|
|
5220
|
-
|
|
5221
|
-
function canResendFn(idxResponse) {
|
|
5222
|
-
return Object.keys(idxResponse.actions).some(function (actionName) {
|
|
5223
|
-
return actionName.includes('resend');
|
|
5215
|
+
return name === 'authenticator';
|
|
5224
5216
|
});
|
|
5225
5217
|
}
|
|
5226
5218
|
|
|
5227
|
-
function
|
|
5228
|
-
var _a;
|
|
5219
|
+
function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
5229
5220
|
|
|
5230
|
-
|
|
5221
|
+
function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
|
|
5231
5222
|
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5223
|
+
function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5224
|
+
var Remediator = /*#__PURE__*/function () {
|
|
5225
|
+
function Remediator(remediation) {
|
|
5226
|
+
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5235
5227
|
|
|
5236
|
-
|
|
5237
|
-
neededToProceed = idxResponse.neededToProceed;
|
|
5238
|
-
var globalMessages = (_a = rawIdxState.messages) === null || _a === void 0 ? void 0 : _a.value.map(function (message) {
|
|
5239
|
-
return message;
|
|
5240
|
-
});
|
|
5228
|
+
_classCallCheck(this, Remediator);
|
|
5241
5229
|
|
|
5242
|
-
|
|
5243
|
-
|
|
5230
|
+
this.values = Object.assign({}, values);
|
|
5231
|
+
this.formatAuthenticators();
|
|
5232
|
+
this.remediation = remediation;
|
|
5244
5233
|
}
|
|
5245
5234
|
|
|
5246
|
-
|
|
5247
|
-
|
|
5235
|
+
_createClass(Remediator, [{
|
|
5236
|
+
key: "formatAuthenticators",
|
|
5237
|
+
value: function formatAuthenticators() {
|
|
5238
|
+
var _this = this;
|
|
5248
5239
|
|
|
5249
|
-
|
|
5250
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
5251
|
-
var remediation = _step2.value;
|
|
5252
|
-
var T = remediators[remediation.name];
|
|
5240
|
+
this.values.authenticators = this.values.authenticators || [];
|
|
5253
5241
|
|
|
5254
|
-
if (
|
|
5255
|
-
|
|
5256
|
-
|
|
5242
|
+
if (this.values.authenticator) {
|
|
5243
|
+
var hasAuthenticatorInList = this.values.authenticators.some(function (authenticator) {
|
|
5244
|
+
if (typeof authenticator === 'string') {
|
|
5245
|
+
return authenticator === _this.values.authenticator;
|
|
5246
|
+
}
|
|
5257
5247
|
|
|
5258
|
-
|
|
5259
|
-
|
|
5248
|
+
return authenticator.key === _this.values.authenticator;
|
|
5249
|
+
});
|
|
5260
5250
|
|
|
5261
|
-
|
|
5262
|
-
|
|
5251
|
+
if (!hasAuthenticatorInList) {
|
|
5252
|
+
this.values.authenticators.push({
|
|
5253
|
+
key: this.values.authenticator
|
|
5254
|
+
});
|
|
5255
|
+
}
|
|
5263
5256
|
}
|
|
5264
|
-
}
|
|
5265
|
-
} catch (err) {
|
|
5266
|
-
_iterator2.e(err);
|
|
5267
|
-
} finally {
|
|
5268
|
-
_iterator2.f();
|
|
5269
|
-
}
|
|
5270
5257
|
|
|
5271
|
-
|
|
5272
|
-
|
|
5258
|
+
this.values.authenticators = this.values.authenticators.map(function (authenticator) {
|
|
5259
|
+
return typeof authenticator === 'string' ? {
|
|
5260
|
+
key: authenticator
|
|
5261
|
+
} : authenticator;
|
|
5262
|
+
});
|
|
5263
|
+
this.values.authenticatorsData = this.values.authenticators.reduce(function (acc, authenticator) {
|
|
5264
|
+
if (_typeof(authenticator) === 'object' && Object.keys(authenticator).length > 1) {
|
|
5265
|
+
acc.push(authenticator);
|
|
5266
|
+
}
|
|
5273
5267
|
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
}
|
|
5283
|
-
|
|
5268
|
+
return acc;
|
|
5269
|
+
}, this.values.authenticatorsData || []);
|
|
5270
|
+
}
|
|
5271
|
+
}, {
|
|
5272
|
+
key: "getName",
|
|
5273
|
+
value: function getName() {
|
|
5274
|
+
return this.remediation.name;
|
|
5275
|
+
}
|
|
5276
|
+
}, {
|
|
5277
|
+
key: "canRemediate",
|
|
5278
|
+
value: function canRemediate() {
|
|
5279
|
+
var _this2 = this;
|
|
5284
5280
|
|
|
5285
|
-
|
|
5286
|
-
|
|
5281
|
+
if (!this.map) {
|
|
5282
|
+
return false;
|
|
5283
|
+
}
|
|
5287
5284
|
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5285
|
+
var required = getRequiredValues(this.remediation);
|
|
5286
|
+
var needed = required.find(function (key) {
|
|
5287
|
+
return !_this2.hasData(key);
|
|
5288
|
+
});
|
|
5291
5289
|
|
|
5292
|
-
|
|
5293
|
-
|
|
5290
|
+
if (needed) {
|
|
5291
|
+
return false;
|
|
5292
|
+
}
|
|
5294
5293
|
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
var nextStep = remediator && getNextStep(remediator, idxState);
|
|
5302
|
-
return Object.assign({
|
|
5303
|
-
messages: messages
|
|
5304
|
-
}, nextStep && {
|
|
5305
|
-
nextStep: nextStep
|
|
5306
|
-
});
|
|
5307
|
-
}
|
|
5308
|
-
}
|
|
5294
|
+
return true;
|
|
5295
|
+
}
|
|
5296
|
+
}, {
|
|
5297
|
+
key: "getData",
|
|
5298
|
+
value: function getData(key) {
|
|
5299
|
+
var _this3 = this;
|
|
5309
5300
|
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5301
|
+
if (!key) {
|
|
5302
|
+
var allValues = getAllValues(this.remediation);
|
|
5303
|
+
var res = allValues.reduce(function (data, key) {
|
|
5304
|
+
data[key] = _this3.getData(key);
|
|
5305
|
+
return data;
|
|
5306
|
+
}, {});
|
|
5307
|
+
return res;
|
|
5308
|
+
}
|
|
5315
5309
|
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5310
|
+
if (typeof this["map".concat(titleCase(key))] === 'function') {
|
|
5311
|
+
return this["map".concat(titleCase(key))](this.remediation.value.find(function (_ref) {
|
|
5312
|
+
var name = _ref.name;
|
|
5313
|
+
return name === key;
|
|
5314
|
+
}));
|
|
5315
|
+
}
|
|
5320
5316
|
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
}
|
|
5317
|
+
if (!this.map) {
|
|
5318
|
+
return this.values[key];
|
|
5319
|
+
}
|
|
5324
5320
|
|
|
5325
|
-
|
|
5326
|
-
_remediate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(idxResponse, values, options) {
|
|
5327
|
-
var _idxResponse, neededToProceed, interactionCode, remediators, flowMonitor, terminal, messages, actionFromValues, actions, _iterator3, _step3, action, valuesWithoutExecutedAction, remediator, nextStep, name, data, _terminal, _messages, _nextStep;
|
|
5321
|
+
var entry = this.map[key];
|
|
5328
5322
|
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
case 0:
|
|
5333
|
-
_idxResponse = idxResponse, neededToProceed = _idxResponse.neededToProceed, interactionCode = _idxResponse.interactionCode;
|
|
5334
|
-
remediators = options.remediators, flowMonitor = options.flowMonitor;
|
|
5323
|
+
if (!entry) {
|
|
5324
|
+
return this.values[key];
|
|
5325
|
+
}
|
|
5335
5326
|
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
break;
|
|
5339
|
-
}
|
|
5327
|
+
for (var i = 0; i < entry.length; i++) {
|
|
5328
|
+
var val = this.values[entry[i]];
|
|
5340
5329
|
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5330
|
+
if (val) {
|
|
5331
|
+
return val;
|
|
5332
|
+
}
|
|
5333
|
+
}
|
|
5334
|
+
}
|
|
5335
|
+
}, {
|
|
5336
|
+
key: "hasData",
|
|
5337
|
+
value: function hasData(key) {
|
|
5338
|
+
var data = this.getData(key);
|
|
5344
5339
|
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
_context.next = 8;
|
|
5351
|
-
break;
|
|
5352
|
-
}
|
|
5353
|
-
|
|
5354
|
-
return _context.abrupt("return", {
|
|
5355
|
-
terminal: terminal,
|
|
5356
|
-
messages: messages
|
|
5357
|
-
});
|
|
5358
|
-
|
|
5359
|
-
case 8:
|
|
5360
|
-
actionFromValues = getActionFromValues(values, idxResponse);
|
|
5361
|
-
actions = [].concat(_toConsumableArray(options.actions || []), _toConsumableArray(actionFromValues && [actionFromValues] || []));
|
|
5362
|
-
|
|
5363
|
-
if (!actions) {
|
|
5364
|
-
_context.next = 40;
|
|
5365
|
-
break;
|
|
5366
|
-
}
|
|
5367
|
-
|
|
5368
|
-
_iterator3 = _createForOfIteratorHelper$2(actions);
|
|
5369
|
-
_context.prev = 12;
|
|
5370
|
-
|
|
5371
|
-
_iterator3.s();
|
|
5372
|
-
|
|
5373
|
-
case 14:
|
|
5374
|
-
if ((_step3 = _iterator3.n()).done) {
|
|
5375
|
-
_context.next = 32;
|
|
5376
|
-
break;
|
|
5377
|
-
}
|
|
5378
|
-
|
|
5379
|
-
action = _step3.value;
|
|
5380
|
-
valuesWithoutExecutedAction = removeActionFromValues(values);
|
|
5381
|
-
|
|
5382
|
-
if (!(typeof idxResponse.actions[action] === 'function')) {
|
|
5383
|
-
_context.next = 30;
|
|
5384
|
-
break;
|
|
5385
|
-
}
|
|
5386
|
-
|
|
5387
|
-
_context.prev = 18;
|
|
5388
|
-
_context.next = 21;
|
|
5389
|
-
return idxResponse.actions[action]();
|
|
5390
|
-
|
|
5391
|
-
case 21:
|
|
5392
|
-
idxResponse = _context.sent;
|
|
5393
|
-
_context.next = 27;
|
|
5394
|
-
break;
|
|
5395
|
-
|
|
5396
|
-
case 24:
|
|
5397
|
-
_context.prev = 24;
|
|
5398
|
-
_context.t0 = _context["catch"](18);
|
|
5399
|
-
return _context.abrupt("return", handleIdxError(_context.t0, remediators));
|
|
5400
|
-
|
|
5401
|
-
case 27:
|
|
5402
|
-
if (!(action === 'cancel')) {
|
|
5403
|
-
_context.next = 29;
|
|
5404
|
-
break;
|
|
5405
|
-
}
|
|
5406
|
-
|
|
5407
|
-
return _context.abrupt("return", {
|
|
5408
|
-
canceled: true
|
|
5409
|
-
});
|
|
5410
|
-
|
|
5411
|
-
case 29:
|
|
5412
|
-
return _context.abrupt("return", remediate(idxResponse, valuesWithoutExecutedAction, options));
|
|
5413
|
-
|
|
5414
|
-
case 30:
|
|
5415
|
-
_context.next = 14;
|
|
5416
|
-
break;
|
|
5417
|
-
|
|
5418
|
-
case 32:
|
|
5419
|
-
_context.next = 37;
|
|
5420
|
-
break;
|
|
5421
|
-
|
|
5422
|
-
case 34:
|
|
5423
|
-
_context.prev = 34;
|
|
5424
|
-
_context.t1 = _context["catch"](12);
|
|
5425
|
-
|
|
5426
|
-
_iterator3.e(_context.t1);
|
|
5427
|
-
|
|
5428
|
-
case 37:
|
|
5429
|
-
_context.prev = 37;
|
|
5430
|
-
|
|
5431
|
-
_iterator3.f();
|
|
5432
|
-
|
|
5433
|
-
return _context.finish(37);
|
|
5434
|
-
|
|
5435
|
-
case 40:
|
|
5436
|
-
remediator = getRemediator(neededToProceed, values, options);
|
|
5437
|
-
|
|
5438
|
-
if (remediator) {
|
|
5439
|
-
_context.next = 43;
|
|
5440
|
-
break;
|
|
5441
|
-
}
|
|
5442
|
-
|
|
5443
|
-
throw new AuthSdkError("\n No remediation can match current flow, check policy settings in your org.\n Remediations: [".concat(neededToProceed.reduce(function (acc, curr) {
|
|
5444
|
-
return acc ? acc + ' ,' + curr.name : curr.name;
|
|
5445
|
-
}, ''), "]\n "));
|
|
5446
|
-
|
|
5447
|
-
case 43:
|
|
5448
|
-
if (!flowMonitor.loopDetected(remediator)) {
|
|
5449
|
-
_context.next = 45;
|
|
5450
|
-
break;
|
|
5451
|
-
}
|
|
5452
|
-
|
|
5453
|
-
throw new AuthSdkError("\n Remediation run into loop, break!!! remediation: ".concat(remediator.getName(), "\n "));
|
|
5454
|
-
|
|
5455
|
-
case 45:
|
|
5456
|
-
if (remediator.canRemediate()) {
|
|
5457
|
-
_context.next = 48;
|
|
5458
|
-
break;
|
|
5459
|
-
}
|
|
5460
|
-
|
|
5461
|
-
nextStep = getNextStep(remediator, idxResponse);
|
|
5462
|
-
return _context.abrupt("return", {
|
|
5463
|
-
idxResponse: idxResponse,
|
|
5464
|
-
nextStep: nextStep
|
|
5465
|
-
});
|
|
5466
|
-
|
|
5467
|
-
case 48:
|
|
5468
|
-
name = remediator.getName();
|
|
5469
|
-
data = remediator.getData();
|
|
5470
|
-
_context.prev = 50;
|
|
5471
|
-
_context.next = 53;
|
|
5472
|
-
return idxResponse.proceed(name, data);
|
|
5473
|
-
|
|
5474
|
-
case 53:
|
|
5475
|
-
idxResponse = _context.sent;
|
|
5476
|
-
_context.next = 56;
|
|
5477
|
-
return flowMonitor.trackRemediations(name);
|
|
5478
|
-
|
|
5479
|
-
case 56:
|
|
5480
|
-
if (!idxResponse.interactionCode) {
|
|
5481
|
-
_context.next = 58;
|
|
5482
|
-
break;
|
|
5483
|
-
}
|
|
5484
|
-
|
|
5485
|
-
return _context.abrupt("return", {
|
|
5486
|
-
idxResponse: idxResponse
|
|
5487
|
-
});
|
|
5488
|
-
|
|
5489
|
-
case 58:
|
|
5490
|
-
_terminal = isTerminalResponse(idxResponse);
|
|
5491
|
-
_messages = getIdxMessages(idxResponse, remediators);
|
|
5492
|
-
|
|
5493
|
-
if (!_terminal) {
|
|
5494
|
-
_context.next = 62;
|
|
5495
|
-
break;
|
|
5496
|
-
}
|
|
5497
|
-
|
|
5498
|
-
return _context.abrupt("return", {
|
|
5499
|
-
terminal: _terminal,
|
|
5500
|
-
messages: _messages
|
|
5501
|
-
});
|
|
5502
|
-
|
|
5503
|
-
case 62:
|
|
5504
|
-
if (!_messages.length) {
|
|
5505
|
-
_context.next = 65;
|
|
5506
|
-
break;
|
|
5507
|
-
}
|
|
5508
|
-
|
|
5509
|
-
_nextStep = getNextStep(remediator, idxResponse);
|
|
5510
|
-
return _context.abrupt("return", {
|
|
5511
|
-
nextStep: _nextStep,
|
|
5512
|
-
messages: _messages
|
|
5513
|
-
});
|
|
5514
|
-
|
|
5515
|
-
case 65:
|
|
5516
|
-
values = remediator.getValuesAfterProceed();
|
|
5517
|
-
return _context.abrupt("return", remediate(idxResponse, values, options));
|
|
5518
|
-
|
|
5519
|
-
case 69:
|
|
5520
|
-
_context.prev = 69;
|
|
5521
|
-
_context.t2 = _context["catch"](50);
|
|
5522
|
-
return _context.abrupt("return", handleIdxError(_context.t2, remediators, remediator));
|
|
5523
|
-
|
|
5524
|
-
case 72:
|
|
5525
|
-
case "end":
|
|
5526
|
-
return _context.stop();
|
|
5527
|
-
}
|
|
5528
|
-
}
|
|
5529
|
-
}, _callee, null, [[12, 34, 37, 40], [18, 24], [50, 69]]);
|
|
5530
|
-
}));
|
|
5531
|
-
return _remediate.apply(this, arguments);
|
|
5532
|
-
}
|
|
5533
|
-
|
|
5534
|
-
function getAllValues(idxRemediation) {
|
|
5535
|
-
return idxRemediation.value.map(function (r) {
|
|
5536
|
-
return r.name;
|
|
5537
|
-
});
|
|
5538
|
-
}
|
|
5539
|
-
function getRequiredValues(idxRemediation) {
|
|
5540
|
-
return idxRemediation.value.reduce(function (required, cur) {
|
|
5541
|
-
if (cur.required) {
|
|
5542
|
-
required.push(cur.name);
|
|
5543
|
-
}
|
|
5544
|
-
|
|
5545
|
-
return required;
|
|
5546
|
-
}, []);
|
|
5547
|
-
}
|
|
5548
|
-
function titleCase(str) {
|
|
5549
|
-
return str.charAt(0).toUpperCase() + str.substring(1);
|
|
5550
|
-
}
|
|
5551
|
-
function getAuthenticatorFromRemediation(remediation) {
|
|
5552
|
-
return remediation.value.find(function (_ref) {
|
|
5553
|
-
var name = _ref.name;
|
|
5554
|
-
return name === 'authenticator';
|
|
5555
|
-
});
|
|
5556
|
-
}
|
|
5557
|
-
|
|
5558
|
-
var Remediator = /*#__PURE__*/function () {
|
|
5559
|
-
function Remediator(remediation) {
|
|
5560
|
-
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5561
|
-
|
|
5562
|
-
_classCallCheck(this, Remediator);
|
|
5563
|
-
|
|
5564
|
-
var _a;
|
|
5565
|
-
|
|
5566
|
-
values.authenticators = ((_a = values.authenticators) === null || _a === void 0 ? void 0 : _a.map(function (authenticator) {
|
|
5567
|
-
return typeof authenticator === 'string' ? {
|
|
5568
|
-
key: authenticator
|
|
5569
|
-
} : authenticator;
|
|
5570
|
-
})) || [];
|
|
5571
|
-
this.values = values;
|
|
5572
|
-
this.remediation = remediation;
|
|
5573
|
-
}
|
|
5574
|
-
|
|
5575
|
-
_createClass(Remediator, [{
|
|
5576
|
-
key: "getName",
|
|
5577
|
-
value: function getName() {
|
|
5578
|
-
return this.remediation.name;
|
|
5579
|
-
}
|
|
5580
|
-
}, {
|
|
5581
|
-
key: "canRemediate",
|
|
5582
|
-
value: function canRemediate() {
|
|
5583
|
-
var _this = this;
|
|
5584
|
-
|
|
5585
|
-
if (!this.map) {
|
|
5586
|
-
return false;
|
|
5587
|
-
}
|
|
5588
|
-
|
|
5589
|
-
var required = getRequiredValues(this.remediation);
|
|
5590
|
-
var needed = required.find(function (key) {
|
|
5591
|
-
return !_this.hasData(key);
|
|
5592
|
-
});
|
|
5593
|
-
|
|
5594
|
-
if (needed) {
|
|
5595
|
-
return false;
|
|
5596
|
-
}
|
|
5597
|
-
|
|
5598
|
-
return true;
|
|
5599
|
-
}
|
|
5600
|
-
}, {
|
|
5601
|
-
key: "getData",
|
|
5602
|
-
value: function getData(key) {
|
|
5603
|
-
var _this2 = this;
|
|
5604
|
-
|
|
5605
|
-
if (!key) {
|
|
5606
|
-
var allValues = getAllValues(this.remediation);
|
|
5607
|
-
var res = allValues.reduce(function (data, key) {
|
|
5608
|
-
data[key] = _this2.getData(key);
|
|
5609
|
-
return data;
|
|
5610
|
-
}, {});
|
|
5611
|
-
return res;
|
|
5612
|
-
}
|
|
5613
|
-
|
|
5614
|
-
if (typeof this["map".concat(titleCase(key))] === 'function') {
|
|
5615
|
-
return this["map".concat(titleCase(key))](this.remediation.value.find(function (_ref) {
|
|
5616
|
-
var name = _ref.name;
|
|
5617
|
-
return name === key;
|
|
5618
|
-
}));
|
|
5619
|
-
}
|
|
5620
|
-
|
|
5621
|
-
if (!this.map) {
|
|
5622
|
-
return this.values[key];
|
|
5623
|
-
}
|
|
5624
|
-
|
|
5625
|
-
var entry = this.map[key];
|
|
5626
|
-
|
|
5627
|
-
if (!entry) {
|
|
5628
|
-
return this.values[key];
|
|
5629
|
-
}
|
|
5630
|
-
|
|
5631
|
-
for (var i = 0; i < entry.length; i++) {
|
|
5632
|
-
var val = this.values[entry[i]];
|
|
5633
|
-
|
|
5634
|
-
if (val) {
|
|
5635
|
-
return val;
|
|
5636
|
-
}
|
|
5637
|
-
}
|
|
5638
|
-
}
|
|
5639
|
-
}, {
|
|
5640
|
-
key: "hasData",
|
|
5641
|
-
value: function hasData(key) {
|
|
5642
|
-
var data = this.getData(key);
|
|
5643
|
-
|
|
5644
|
-
if (_typeof(data) === 'object') {
|
|
5645
|
-
return !!Object.keys(data).find(function (key) {
|
|
5646
|
-
return !!data[key];
|
|
5647
|
-
});
|
|
5648
|
-
}
|
|
5340
|
+
if (_typeof(data) === 'object') {
|
|
5341
|
+
return !!Object.keys(data).find(function (key) {
|
|
5342
|
+
return !!data[key];
|
|
5343
|
+
});
|
|
5344
|
+
}
|
|
5649
5345
|
|
|
5650
5346
|
return !!data;
|
|
5651
5347
|
}
|
|
5652
5348
|
}, {
|
|
5653
5349
|
key: "getNextStep",
|
|
5654
|
-
value: function getNextStep() {
|
|
5350
|
+
value: function getNextStep(_context) {
|
|
5655
5351
|
var name = this.getName();
|
|
5656
5352
|
var inputs = this.getInputs();
|
|
5657
5353
|
var authenticator = this.getAuthenticator();
|
|
@@ -5668,14 +5364,14 @@ var Remediator = /*#__PURE__*/function () {
|
|
|
5668
5364
|
}, {
|
|
5669
5365
|
key: "getInputs",
|
|
5670
5366
|
value: function getInputs() {
|
|
5671
|
-
var
|
|
5367
|
+
var _this4 = this;
|
|
5672
5368
|
|
|
5673
5369
|
if (!this.map) {
|
|
5674
5370
|
return [];
|
|
5675
5371
|
}
|
|
5676
5372
|
|
|
5677
5373
|
return Object.keys(this.map).reduce(function (inputs, key) {
|
|
5678
|
-
var inputFromRemediation =
|
|
5374
|
+
var inputFromRemediation = _this4.remediation.value.find(function (item) {
|
|
5679
5375
|
return item.name === key;
|
|
5680
5376
|
});
|
|
5681
5377
|
|
|
@@ -5684,11 +5380,11 @@ var Remediator = /*#__PURE__*/function () {
|
|
|
5684
5380
|
}
|
|
5685
5381
|
|
|
5686
5382
|
var input;
|
|
5687
|
-
var aliases =
|
|
5383
|
+
var aliases = _this4.map[key];
|
|
5688
5384
|
var type = inputFromRemediation.type;
|
|
5689
5385
|
|
|
5690
|
-
if (typeof
|
|
5691
|
-
input =
|
|
5386
|
+
if (typeof _this4["getInput".concat(titleCase(key))] === 'function') {
|
|
5387
|
+
input = _this4["getInput".concat(titleCase(key))](inputFromRemediation);
|
|
5692
5388
|
} else if (type !== 'object') {
|
|
5693
5389
|
var name;
|
|
5694
5390
|
|
|
@@ -5696,7 +5392,7 @@ var Remediator = /*#__PURE__*/function () {
|
|
|
5696
5392
|
name = aliases[0];
|
|
5697
5393
|
} else {
|
|
5698
5394
|
name = aliases.find(function (name) {
|
|
5699
|
-
return Object.keys(
|
|
5395
|
+
return Object.keys(_this4.values).includes(name);
|
|
5700
5396
|
});
|
|
5701
5397
|
}
|
|
5702
5398
|
|
|
@@ -5708,7 +5404,7 @@ var Remediator = /*#__PURE__*/function () {
|
|
|
5708
5404
|
}
|
|
5709
5405
|
|
|
5710
5406
|
if (!input) {
|
|
5711
|
-
throw new AuthSdkError("Missing custom getInput".concat(titleCase(key), " method in Remediator: ").concat(
|
|
5407
|
+
throw new AuthSdkError("Missing custom getInput".concat(titleCase(key), " method in Remediator: ").concat(_this4.getName()));
|
|
5712
5408
|
}
|
|
5713
5409
|
|
|
5714
5410
|
if (Array.isArray(input)) {
|
|
@@ -5723,119 +5419,344 @@ var Remediator = /*#__PURE__*/function () {
|
|
|
5723
5419
|
}, []);
|
|
5724
5420
|
}
|
|
5725
5421
|
}, {
|
|
5726
|
-
key: "
|
|
5727
|
-
value: function
|
|
5728
|
-
var
|
|
5422
|
+
key: "getValuesAfterProceed",
|
|
5423
|
+
value: function getValuesAfterProceed() {
|
|
5424
|
+
var inputs = this.getInputs();
|
|
5729
5425
|
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
}
|
|
5426
|
+
var _iterator = _createForOfIteratorHelper$3(inputs),
|
|
5427
|
+
_step;
|
|
5733
5428
|
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5429
|
+
try {
|
|
5430
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
5431
|
+
var input = _step.value;
|
|
5432
|
+
delete this.values[input.name];
|
|
5433
|
+
}
|
|
5434
|
+
} catch (err) {
|
|
5435
|
+
_iterator.e(err);
|
|
5436
|
+
} finally {
|
|
5437
|
+
_iterator.f();
|
|
5438
|
+
}
|
|
5439
|
+
|
|
5440
|
+
return this.values;
|
|
5441
|
+
}
|
|
5442
|
+
}, {
|
|
5443
|
+
key: "getAuthenticator",
|
|
5444
|
+
value: function getAuthenticator() {
|
|
5445
|
+
var _a;
|
|
5446
|
+
|
|
5447
|
+
return (_a = this.remediation.relatesTo) === null || _a === void 0 ? void 0 : _a.value;
|
|
5448
|
+
}
|
|
5449
|
+
}], [{
|
|
5450
|
+
key: "getMessages",
|
|
5451
|
+
value: function getMessages(remediation) {
|
|
5452
|
+
var _a, _b;
|
|
5453
|
+
|
|
5454
|
+
if (!remediation.value) {
|
|
5455
|
+
return;
|
|
5456
|
+
}
|
|
5457
|
+
|
|
5458
|
+
return (_b = (_a = remediation.value[0]) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.value.reduce(function (messages, field) {
|
|
5459
|
+
if (field.messages) {
|
|
5460
|
+
messages = [].concat(_toConsumableArray(messages), _toConsumableArray(field.messages.value));
|
|
5737
5461
|
}
|
|
5738
5462
|
|
|
5739
5463
|
return messages;
|
|
5740
5464
|
}, []);
|
|
5741
5465
|
}
|
|
5466
|
+
}]);
|
|
5467
|
+
|
|
5468
|
+
return Remediator;
|
|
5469
|
+
}();
|
|
5470
|
+
|
|
5471
|
+
var Authenticator = function Authenticator(authenticator) {
|
|
5472
|
+
_classCallCheck(this, Authenticator);
|
|
5473
|
+
|
|
5474
|
+
this.meta = authenticator;
|
|
5475
|
+
};
|
|
5476
|
+
|
|
5477
|
+
function _createSuper$m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5478
|
+
|
|
5479
|
+
function _isNativeReflectConstruct$m() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5480
|
+
var VerificationCodeAuthenticator = /*#__PURE__*/function (_Authenticator) {
|
|
5481
|
+
_inherits(VerificationCodeAuthenticator, _Authenticator);
|
|
5482
|
+
|
|
5483
|
+
var _super = _createSuper$m(VerificationCodeAuthenticator);
|
|
5484
|
+
|
|
5485
|
+
function VerificationCodeAuthenticator() {
|
|
5486
|
+
_classCallCheck(this, VerificationCodeAuthenticator);
|
|
5487
|
+
|
|
5488
|
+
return _super.apply(this, arguments);
|
|
5489
|
+
}
|
|
5490
|
+
|
|
5491
|
+
_createClass(VerificationCodeAuthenticator, [{
|
|
5492
|
+
key: "canVerify",
|
|
5493
|
+
value: function canVerify(values) {
|
|
5494
|
+
return !!values.verificationCode;
|
|
5495
|
+
}
|
|
5742
5496
|
}, {
|
|
5743
|
-
key: "
|
|
5744
|
-
value: function
|
|
5745
|
-
|
|
5497
|
+
key: "mapCredentials",
|
|
5498
|
+
value: function mapCredentials(values) {
|
|
5499
|
+
return {
|
|
5500
|
+
passcode: values.verificationCode
|
|
5501
|
+
};
|
|
5502
|
+
}
|
|
5503
|
+
}, {
|
|
5504
|
+
key: "getInputs",
|
|
5505
|
+
value: function getInputs(idxRemediationValue) {
|
|
5506
|
+
var _a;
|
|
5746
5507
|
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
return Object.assign(Object.assign({}, this.values), {
|
|
5752
|
-
authenticators: authenticators
|
|
5508
|
+
return Object.assign(Object.assign({}, (_a = idxRemediationValue.form) === null || _a === void 0 ? void 0 : _a.value[0]), {
|
|
5509
|
+
name: 'verificationCode',
|
|
5510
|
+
type: 'string',
|
|
5511
|
+
required: idxRemediationValue.required
|
|
5753
5512
|
});
|
|
5754
5513
|
}
|
|
5514
|
+
}]);
|
|
5515
|
+
|
|
5516
|
+
return VerificationCodeAuthenticator;
|
|
5517
|
+
}(Authenticator);
|
|
5518
|
+
|
|
5519
|
+
function _createSuper$l(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$l(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5520
|
+
|
|
5521
|
+
function _isNativeReflectConstruct$l() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5522
|
+
var OktaVerifyTotp = /*#__PURE__*/function (_VerificationCodeAuth) {
|
|
5523
|
+
_inherits(OktaVerifyTotp, _VerificationCodeAuth);
|
|
5524
|
+
|
|
5525
|
+
var _super = _createSuper$l(OktaVerifyTotp);
|
|
5526
|
+
|
|
5527
|
+
function OktaVerifyTotp() {
|
|
5528
|
+
_classCallCheck(this, OktaVerifyTotp);
|
|
5529
|
+
|
|
5530
|
+
return _super.apply(this, arguments);
|
|
5531
|
+
}
|
|
5532
|
+
|
|
5533
|
+
_createClass(OktaVerifyTotp, [{
|
|
5534
|
+
key: "mapCredentials",
|
|
5535
|
+
value: function mapCredentials(values) {
|
|
5536
|
+
return {
|
|
5537
|
+
totp: values.verificationCode
|
|
5538
|
+
};
|
|
5539
|
+
}
|
|
5540
|
+
}]);
|
|
5541
|
+
|
|
5542
|
+
return OktaVerifyTotp;
|
|
5543
|
+
}(VerificationCodeAuthenticator);
|
|
5544
|
+
|
|
5545
|
+
function _createSuper$k(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$k(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5546
|
+
|
|
5547
|
+
function _isNativeReflectConstruct$k() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5548
|
+
var OktaPassword = /*#__PURE__*/function (_Authenticator) {
|
|
5549
|
+
_inherits(OktaPassword, _Authenticator);
|
|
5550
|
+
|
|
5551
|
+
var _super = _createSuper$k(OktaPassword);
|
|
5552
|
+
|
|
5553
|
+
function OktaPassword() {
|
|
5554
|
+
_classCallCheck(this, OktaPassword);
|
|
5555
|
+
|
|
5556
|
+
return _super.apply(this, arguments);
|
|
5557
|
+
}
|
|
5558
|
+
|
|
5559
|
+
_createClass(OktaPassword, [{
|
|
5560
|
+
key: "canVerify",
|
|
5561
|
+
value: function canVerify(values) {
|
|
5562
|
+
return !!values.password;
|
|
5563
|
+
}
|
|
5755
5564
|
}, {
|
|
5756
|
-
key: "
|
|
5757
|
-
value: function
|
|
5565
|
+
key: "mapCredentials",
|
|
5566
|
+
value: function mapCredentials(values) {
|
|
5567
|
+
return {
|
|
5568
|
+
passcode: values.password
|
|
5569
|
+
};
|
|
5570
|
+
}
|
|
5571
|
+
}, {
|
|
5572
|
+
key: "getInputs",
|
|
5573
|
+
value: function getInputs(idxRemediationValue) {
|
|
5758
5574
|
var _a;
|
|
5759
5575
|
|
|
5760
|
-
return (_a =
|
|
5576
|
+
return Object.assign(Object.assign({}, (_a = idxRemediationValue.form) === null || _a === void 0 ? void 0 : _a.value[0]), {
|
|
5577
|
+
name: 'password',
|
|
5578
|
+
type: 'string',
|
|
5579
|
+
required: idxRemediationValue.required
|
|
5580
|
+
});
|
|
5761
5581
|
}
|
|
5762
5582
|
}]);
|
|
5763
5583
|
|
|
5764
|
-
return
|
|
5765
|
-
}();
|
|
5584
|
+
return OktaPassword;
|
|
5585
|
+
}(Authenticator);
|
|
5586
|
+
|
|
5587
|
+
function _createSuper$j(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$j(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5588
|
+
|
|
5589
|
+
function _isNativeReflectConstruct$j() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5590
|
+
var SecurityQuestionEnrollment = /*#__PURE__*/function (_Authenticator) {
|
|
5591
|
+
_inherits(SecurityQuestionEnrollment, _Authenticator);
|
|
5592
|
+
|
|
5593
|
+
var _super = _createSuper$j(SecurityQuestionEnrollment);
|
|
5594
|
+
|
|
5595
|
+
function SecurityQuestionEnrollment() {
|
|
5596
|
+
_classCallCheck(this, SecurityQuestionEnrollment);
|
|
5597
|
+
|
|
5598
|
+
return _super.apply(this, arguments);
|
|
5599
|
+
}
|
|
5600
|
+
|
|
5601
|
+
_createClass(SecurityQuestionEnrollment, [{
|
|
5602
|
+
key: "canVerify",
|
|
5603
|
+
value: function canVerify(values) {
|
|
5604
|
+
var questionKey = values.questionKey,
|
|
5605
|
+
question = values.question,
|
|
5606
|
+
answer = values.answer;
|
|
5607
|
+
return questionKey && answer || question && answer;
|
|
5608
|
+
}
|
|
5609
|
+
}, {
|
|
5610
|
+
key: "mapCredentials",
|
|
5611
|
+
value: function mapCredentials(values) {
|
|
5612
|
+
var questionKey = values.questionKey,
|
|
5613
|
+
question = values.question,
|
|
5614
|
+
answer = values.answer;
|
|
5615
|
+
return {
|
|
5616
|
+
questionKey: question ? 'custom' : questionKey,
|
|
5617
|
+
question: question,
|
|
5618
|
+
answer: answer
|
|
5619
|
+
};
|
|
5620
|
+
}
|
|
5621
|
+
}, {
|
|
5622
|
+
key: "getInputs",
|
|
5623
|
+
value: function getInputs() {
|
|
5624
|
+
return [{
|
|
5625
|
+
name: 'questionKey',
|
|
5626
|
+
type: 'string',
|
|
5627
|
+
require: true
|
|
5628
|
+
}, {
|
|
5629
|
+
name: 'question',
|
|
5630
|
+
type: 'string',
|
|
5631
|
+
label: 'Create a security question'
|
|
5632
|
+
}, {
|
|
5633
|
+
name: 'answer',
|
|
5634
|
+
type: 'string',
|
|
5635
|
+
label: 'Answer',
|
|
5636
|
+
required: true
|
|
5637
|
+
}];
|
|
5638
|
+
}
|
|
5639
|
+
}]);
|
|
5640
|
+
|
|
5641
|
+
return SecurityQuestionEnrollment;
|
|
5642
|
+
}(Authenticator);
|
|
5766
5643
|
|
|
5767
5644
|
function _createSuper$i(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$i(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5768
5645
|
|
|
5769
5646
|
function _isNativeReflectConstruct$i() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5647
|
+
var SecurityQuestionVerification = /*#__PURE__*/function (_Authenticator) {
|
|
5648
|
+
_inherits(SecurityQuestionVerification, _Authenticator);
|
|
5649
|
+
|
|
5650
|
+
var _super = _createSuper$i(SecurityQuestionVerification);
|
|
5651
|
+
|
|
5652
|
+
function SecurityQuestionVerification() {
|
|
5653
|
+
_classCallCheck(this, SecurityQuestionVerification);
|
|
5654
|
+
|
|
5655
|
+
return _super.apply(this, arguments);
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
_createClass(SecurityQuestionVerification, [{
|
|
5659
|
+
key: "canVerify",
|
|
5660
|
+
value: function canVerify(values) {
|
|
5661
|
+
return values.answer;
|
|
5662
|
+
}
|
|
5663
|
+
}, {
|
|
5664
|
+
key: "mapCredentials",
|
|
5665
|
+
value: function mapCredentials(values) {
|
|
5666
|
+
return {
|
|
5667
|
+
questionKey: this.meta.contextualData.enrolledQuestion.questionKey,
|
|
5668
|
+
answer: values.answer
|
|
5669
|
+
};
|
|
5670
|
+
}
|
|
5671
|
+
}, {
|
|
5672
|
+
key: "getInputs",
|
|
5673
|
+
value: function getInputs() {
|
|
5674
|
+
return [{
|
|
5675
|
+
name: 'answer',
|
|
5676
|
+
type: 'string',
|
|
5677
|
+
label: 'Answer',
|
|
5678
|
+
required: true
|
|
5679
|
+
}];
|
|
5680
|
+
}
|
|
5681
|
+
}]);
|
|
5682
|
+
|
|
5683
|
+
return SecurityQuestionVerification;
|
|
5684
|
+
}(Authenticator);
|
|
5685
|
+
|
|
5686
|
+
function getAuthenticator(remediation) {
|
|
5687
|
+
var _remediation$relatesT = remediation.relatesTo;
|
|
5688
|
+
_remediation$relatesT = _remediation$relatesT === void 0 ? {} : _remediation$relatesT;
|
|
5689
|
+
var value = _remediation$relatesT.value;
|
|
5690
|
+
|
|
5691
|
+
switch (value.key) {
|
|
5692
|
+
case AuthenticatorKey.OKTA_PASSWORD:
|
|
5693
|
+
return new OktaPassword(value);
|
|
5694
|
+
|
|
5695
|
+
case AuthenticatorKey.SECURITY_QUESTION:
|
|
5696
|
+
if (value.contextualData.enrolledQuestion) {
|
|
5697
|
+
return new SecurityQuestionVerification(value);
|
|
5698
|
+
} else {
|
|
5699
|
+
return new SecurityQuestionEnrollment(value);
|
|
5700
|
+
}
|
|
5701
|
+
|
|
5702
|
+
case AuthenticatorKey.OKTA_VERIFY:
|
|
5703
|
+
return new OktaVerifyTotp(value);
|
|
5704
|
+
|
|
5705
|
+
default:
|
|
5706
|
+
return new VerificationCodeAuthenticator(value);
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
|
|
5710
|
+
function _createSuper$h(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$h(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5711
|
+
|
|
5712
|
+
function _isNativeReflectConstruct$h() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5770
5713
|
var VerifyAuthenticator = /*#__PURE__*/function (_Remediator) {
|
|
5771
5714
|
_inherits(VerifyAuthenticator, _Remediator);
|
|
5772
5715
|
|
|
5773
|
-
var _super = _createSuper$
|
|
5716
|
+
var _super = _createSuper$h(VerifyAuthenticator);
|
|
5774
5717
|
|
|
5775
|
-
function VerifyAuthenticator() {
|
|
5718
|
+
function VerifyAuthenticator(remediation) {
|
|
5776
5719
|
var _this;
|
|
5777
5720
|
|
|
5721
|
+
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5722
|
+
|
|
5778
5723
|
_classCallCheck(this, VerifyAuthenticator);
|
|
5779
5724
|
|
|
5780
|
-
_this = _super.
|
|
5725
|
+
_this = _super.call(this, remediation, values);
|
|
5781
5726
|
_this.map = {
|
|
5782
5727
|
'credentials': []
|
|
5783
5728
|
};
|
|
5729
|
+
_this.authenticator = getAuthenticator(remediation);
|
|
5784
5730
|
return _this;
|
|
5785
5731
|
}
|
|
5786
5732
|
|
|
5787
5733
|
_createClass(VerifyAuthenticator, [{
|
|
5788
5734
|
key: "canRemediate",
|
|
5789
5735
|
value: function canRemediate() {
|
|
5790
|
-
return
|
|
5736
|
+
return this.authenticator.canVerify(this.values);
|
|
5791
5737
|
}
|
|
5792
5738
|
}, {
|
|
5793
5739
|
key: "mapCredentials",
|
|
5794
5740
|
value: function mapCredentials() {
|
|
5795
|
-
return
|
|
5796
|
-
passcode: this.values.verificationCode || this.values.password
|
|
5797
|
-
};
|
|
5741
|
+
return this.authenticator.mapCredentials(this.values);
|
|
5798
5742
|
}
|
|
5799
5743
|
}, {
|
|
5800
5744
|
key: "getInputCredentials",
|
|
5801
5745
|
value: function getInputCredentials(input) {
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
var challengeType = this.getAuthenticator().type;
|
|
5805
|
-
var name = challengeType === 'password' ? 'password' : 'verificationCode';
|
|
5806
|
-
return Object.assign(Object.assign({}, (_a = input.form) === null || _a === void 0 ? void 0 : _a.value[0]), {
|
|
5807
|
-
name: name,
|
|
5808
|
-
type: 'string',
|
|
5809
|
-
required: input.required
|
|
5810
|
-
});
|
|
5811
|
-
}
|
|
5812
|
-
}, {
|
|
5813
|
-
key: "getValuesAfterProceed",
|
|
5814
|
-
value: function getValuesAfterProceed() {
|
|
5815
|
-
var values = _get(_getPrototypeOf(VerifyAuthenticator.prototype), "getValuesAfterProceed", this).call(this);
|
|
5816
|
-
|
|
5817
|
-
var authenticator = this.getAuthenticator();
|
|
5818
|
-
|
|
5819
|
-
if (authenticator.type === 'password') {
|
|
5820
|
-
delete values.password;
|
|
5821
|
-
} else {
|
|
5822
|
-
delete values.verificationCode;
|
|
5823
|
-
}
|
|
5824
|
-
|
|
5825
|
-
return values;
|
|
5746
|
+
return this.authenticator.getInputs(input);
|
|
5826
5747
|
}
|
|
5827
5748
|
}]);
|
|
5828
5749
|
|
|
5829
5750
|
return VerifyAuthenticator;
|
|
5830
5751
|
}(Remediator);
|
|
5831
5752
|
|
|
5832
|
-
function _createSuper$
|
|
5753
|
+
function _createSuper$g(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$g(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5833
5754
|
|
|
5834
|
-
function _isNativeReflectConstruct$
|
|
5755
|
+
function _isNativeReflectConstruct$g() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5835
5756
|
var EnrollAuthenticator = /*#__PURE__*/function (_VerifyAuthenticator) {
|
|
5836
5757
|
_inherits(EnrollAuthenticator, _VerifyAuthenticator);
|
|
5837
5758
|
|
|
5838
|
-
var _super = _createSuper$
|
|
5759
|
+
var _super = _createSuper$g(EnrollAuthenticator);
|
|
5839
5760
|
|
|
5840
5761
|
function EnrollAuthenticator() {
|
|
5841
5762
|
_classCallCheck(this, EnrollAuthenticator);
|
|
@@ -5847,13 +5768,69 @@ var EnrollAuthenticator = /*#__PURE__*/function (_VerifyAuthenticator) {
|
|
|
5847
5768
|
}(VerifyAuthenticator);
|
|
5848
5769
|
EnrollAuthenticator.remediationName = 'enroll-authenticator';
|
|
5849
5770
|
|
|
5850
|
-
function _createSuper$
|
|
5771
|
+
function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5851
5772
|
|
|
5852
|
-
function _isNativeReflectConstruct$
|
|
5773
|
+
function _isNativeReflectConstruct$f() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5774
|
+
var EnrollPoll = /*#__PURE__*/function (_Remediator) {
|
|
5775
|
+
_inherits(EnrollPoll, _Remediator);
|
|
5776
|
+
|
|
5777
|
+
var _super = _createSuper$f(EnrollPoll);
|
|
5778
|
+
|
|
5779
|
+
function EnrollPoll() {
|
|
5780
|
+
_classCallCheck(this, EnrollPoll);
|
|
5781
|
+
|
|
5782
|
+
return _super.apply(this, arguments);
|
|
5783
|
+
}
|
|
5784
|
+
|
|
5785
|
+
_createClass(EnrollPoll, [{
|
|
5786
|
+
key: "canRemediate",
|
|
5787
|
+
value: function canRemediate() {
|
|
5788
|
+
return Boolean(this.values.startPolling);
|
|
5789
|
+
}
|
|
5790
|
+
}, {
|
|
5791
|
+
key: "getNextStep",
|
|
5792
|
+
value: function getNextStep(context) {
|
|
5793
|
+
var name = this.getName();
|
|
5794
|
+
var authenticator = this.getAuthenticator();
|
|
5795
|
+
|
|
5796
|
+
if (!authenticator && (context === null || context === void 0 ? void 0 : context.currentAuthenticator)) {
|
|
5797
|
+
authenticator = context.currentAuthenticator.value;
|
|
5798
|
+
}
|
|
5799
|
+
|
|
5800
|
+
return {
|
|
5801
|
+
name: name,
|
|
5802
|
+
authenticator: authenticator,
|
|
5803
|
+
poll: {
|
|
5804
|
+
required: true,
|
|
5805
|
+
refresh: this.remediation.refresh
|
|
5806
|
+
}
|
|
5807
|
+
};
|
|
5808
|
+
}
|
|
5809
|
+
}, {
|
|
5810
|
+
key: "getValuesAfterProceed",
|
|
5811
|
+
value: function getValuesAfterProceed() {
|
|
5812
|
+
var _this = this;
|
|
5813
|
+
|
|
5814
|
+
var trimmedValues = Object.keys(this.values).filter(function (valueKey) {
|
|
5815
|
+
return valueKey !== 'startPolling';
|
|
5816
|
+
});
|
|
5817
|
+
return trimmedValues.reduce(function (values, valueKey) {
|
|
5818
|
+
return Object.assign(Object.assign({}, values), _defineProperty({}, valueKey, _this.values[valueKey]));
|
|
5819
|
+
}, {});
|
|
5820
|
+
}
|
|
5821
|
+
}]);
|
|
5822
|
+
|
|
5823
|
+
return EnrollPoll;
|
|
5824
|
+
}(Remediator);
|
|
5825
|
+
EnrollPoll.remediationName = 'enroll-poll';
|
|
5826
|
+
|
|
5827
|
+
function _createSuper$e(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$e(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5828
|
+
|
|
5829
|
+
function _isNativeReflectConstruct$e() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5853
5830
|
var ChallengeAuthenticator = /*#__PURE__*/function (_VerifyAuthenticator) {
|
|
5854
5831
|
_inherits(ChallengeAuthenticator, _VerifyAuthenticator);
|
|
5855
5832
|
|
|
5856
|
-
var _super = _createSuper$
|
|
5833
|
+
var _super = _createSuper$e(ChallengeAuthenticator);
|
|
5857
5834
|
|
|
5858
5835
|
function ChallengeAuthenticator() {
|
|
5859
5836
|
_classCallCheck(this, ChallengeAuthenticator);
|
|
@@ -5865,13 +5842,31 @@ var ChallengeAuthenticator = /*#__PURE__*/function (_VerifyAuthenticator) {
|
|
|
5865
5842
|
}(VerifyAuthenticator);
|
|
5866
5843
|
ChallengeAuthenticator.remediationName = 'challenge-authenticator';
|
|
5867
5844
|
|
|
5868
|
-
function _createSuper$
|
|
5845
|
+
function _createSuper$d(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$d(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5869
5846
|
|
|
5870
|
-
function _isNativeReflectConstruct$
|
|
5847
|
+
function _isNativeReflectConstruct$d() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5848
|
+
var ChallengePoll = /*#__PURE__*/function (_EnrollPoll) {
|
|
5849
|
+
_inherits(ChallengePoll, _EnrollPoll);
|
|
5850
|
+
|
|
5851
|
+
var _super = _createSuper$d(ChallengePoll);
|
|
5852
|
+
|
|
5853
|
+
function ChallengePoll() {
|
|
5854
|
+
_classCallCheck(this, ChallengePoll);
|
|
5855
|
+
|
|
5856
|
+
return _super.apply(this, arguments);
|
|
5857
|
+
}
|
|
5858
|
+
|
|
5859
|
+
return ChallengePoll;
|
|
5860
|
+
}(EnrollPoll);
|
|
5861
|
+
ChallengePoll.remediationName = 'challenge-poll';
|
|
5862
|
+
|
|
5863
|
+
function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5864
|
+
|
|
5865
|
+
function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5871
5866
|
var ResetAuthenticator = /*#__PURE__*/function (_VerifyAuthenticator) {
|
|
5872
5867
|
_inherits(ResetAuthenticator, _VerifyAuthenticator);
|
|
5873
5868
|
|
|
5874
|
-
var _super = _createSuper$
|
|
5869
|
+
var _super = _createSuper$c(ResetAuthenticator);
|
|
5875
5870
|
|
|
5876
5871
|
function ResetAuthenticator() {
|
|
5877
5872
|
_classCallCheck(this, ResetAuthenticator);
|
|
@@ -5883,13 +5878,13 @@ var ResetAuthenticator = /*#__PURE__*/function (_VerifyAuthenticator) {
|
|
|
5883
5878
|
}(VerifyAuthenticator);
|
|
5884
5879
|
ResetAuthenticator.remediationName = 'reset-authenticator';
|
|
5885
5880
|
|
|
5886
|
-
function _createSuper$
|
|
5881
|
+
function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5887
5882
|
|
|
5888
|
-
function _isNativeReflectConstruct$
|
|
5883
|
+
function _isNativeReflectConstruct$b() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5889
5884
|
var EnrollProfile = /*#__PURE__*/function (_Remediator) {
|
|
5890
5885
|
_inherits(EnrollProfile, _Remediator);
|
|
5891
5886
|
|
|
5892
|
-
var _super = _createSuper$
|
|
5887
|
+
var _super = _createSuper$b(EnrollProfile);
|
|
5893
5888
|
|
|
5894
5889
|
function EnrollProfile() {
|
|
5895
5890
|
var _this;
|
|
@@ -5955,40 +5950,25 @@ var EnrollProfile = /*#__PURE__*/function (_Remediator) {
|
|
|
5955
5950
|
}(Remediator);
|
|
5956
5951
|
EnrollProfile.remediationName = 'enroll-profile';
|
|
5957
5952
|
|
|
5958
|
-
function _createSuper$
|
|
5953
|
+
function _createSuper$a(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5959
5954
|
|
|
5960
|
-
function _isNativeReflectConstruct$
|
|
5955
|
+
function _isNativeReflectConstruct$a() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5961
5956
|
var Identify = /*#__PURE__*/function (_Remediator) {
|
|
5962
5957
|
_inherits(Identify, _Remediator);
|
|
5963
5958
|
|
|
5964
|
-
var _super = _createSuper$
|
|
5959
|
+
var _super = _createSuper$a(Identify);
|
|
5965
5960
|
|
|
5966
|
-
function Identify(
|
|
5961
|
+
function Identify() {
|
|
5967
5962
|
var _this;
|
|
5968
5963
|
|
|
5969
5964
|
_classCallCheck(this, Identify);
|
|
5970
5965
|
|
|
5971
|
-
_this = _super.
|
|
5966
|
+
_this = _super.apply(this, arguments);
|
|
5972
5967
|
_this.map = {
|
|
5973
5968
|
'identifier': ['username'],
|
|
5974
5969
|
'credentials': [],
|
|
5975
5970
|
'rememberMe': ['rememberMe']
|
|
5976
5971
|
};
|
|
5977
|
-
var _this$values = _this.values,
|
|
5978
|
-
password = _this$values.password,
|
|
5979
|
-
authenticators = _this$values.authenticators;
|
|
5980
|
-
|
|
5981
|
-
if (password && !authenticators.some(function (authenticator) {
|
|
5982
|
-
return authenticator.type === 'password';
|
|
5983
|
-
})) {
|
|
5984
|
-
_this.values = Object.assign(Object.assign({}, _this.values), {
|
|
5985
|
-
authenticators: [{
|
|
5986
|
-
type: 'password',
|
|
5987
|
-
key: AuthenticatorKey.OKTA_PASSWORD
|
|
5988
|
-
}].concat(_toConsumableArray(authenticators))
|
|
5989
|
-
});
|
|
5990
|
-
}
|
|
5991
|
-
|
|
5992
5972
|
return _this;
|
|
5993
5973
|
}
|
|
5994
5974
|
|
|
@@ -6015,38 +5995,19 @@ var Identify = /*#__PURE__*/function (_Remediator) {
|
|
|
6015
5995
|
required: input.required
|
|
6016
5996
|
});
|
|
6017
5997
|
}
|
|
6018
|
-
}, {
|
|
6019
|
-
key: "getValuesAfterProceed",
|
|
6020
|
-
value: function getValuesAfterProceed() {
|
|
6021
|
-
var _a;
|
|
6022
|
-
|
|
6023
|
-
if (this.remediation.value.some(function (_ref) {
|
|
6024
|
-
var name = _ref.name;
|
|
6025
|
-
return name === 'credentials';
|
|
6026
|
-
})) {
|
|
6027
|
-
var authenticators = (_a = this.values.authenticators) === null || _a === void 0 ? void 0 : _a.filter(function (authenticator) {
|
|
6028
|
-
return authenticator.key !== AuthenticatorKey.OKTA_PASSWORD;
|
|
6029
|
-
});
|
|
6030
|
-
return Object.assign(Object.assign({}, this.values), {
|
|
6031
|
-
authenticators: authenticators
|
|
6032
|
-
});
|
|
6033
|
-
}
|
|
6034
|
-
|
|
6035
|
-
return _get(_getPrototypeOf(Identify.prototype), "getValuesAfterProceed", this).call(this);
|
|
6036
|
-
}
|
|
6037
5998
|
}]);
|
|
6038
5999
|
|
|
6039
6000
|
return Identify;
|
|
6040
6001
|
}(Remediator);
|
|
6041
6002
|
Identify.remediationName = 'identify';
|
|
6042
6003
|
|
|
6043
|
-
function _createSuper$
|
|
6004
|
+
function _createSuper$9(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6044
6005
|
|
|
6045
|
-
function _isNativeReflectConstruct$
|
|
6006
|
+
function _isNativeReflectConstruct$9() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6046
6007
|
var ReEnrollAuthenticator = /*#__PURE__*/function (_Remediator) {
|
|
6047
6008
|
_inherits(ReEnrollAuthenticator, _Remediator);
|
|
6048
6009
|
|
|
6049
|
-
var _super = _createSuper$
|
|
6010
|
+
var _super = _createSuper$9(ReEnrollAuthenticator);
|
|
6050
6011
|
|
|
6051
6012
|
function ReEnrollAuthenticator() {
|
|
6052
6013
|
var _this;
|
|
@@ -6082,13 +6043,13 @@ var ReEnrollAuthenticator = /*#__PURE__*/function (_Remediator) {
|
|
|
6082
6043
|
}(Remediator);
|
|
6083
6044
|
ReEnrollAuthenticator.remediationName = 'reenroll-authenticator';
|
|
6084
6045
|
|
|
6085
|
-
function _createSuper$
|
|
6046
|
+
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6086
6047
|
|
|
6087
|
-
function _isNativeReflectConstruct$
|
|
6048
|
+
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6088
6049
|
var RedirectIdp = /*#__PURE__*/function (_Remediator) {
|
|
6089
6050
|
_inherits(RedirectIdp, _Remediator);
|
|
6090
6051
|
|
|
6091
|
-
var _super = _createSuper$
|
|
6052
|
+
var _super = _createSuper$8(RedirectIdp);
|
|
6092
6053
|
|
|
6093
6054
|
function RedirectIdp() {
|
|
6094
6055
|
_classCallCheck(this, RedirectIdp);
|
|
@@ -6122,20 +6083,20 @@ var RedirectIdp = /*#__PURE__*/function (_Remediator) {
|
|
|
6122
6083
|
}(Remediator);
|
|
6123
6084
|
RedirectIdp.remediationName = 'redirect-idp';
|
|
6124
6085
|
|
|
6125
|
-
function _createSuper$
|
|
6086
|
+
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6126
6087
|
|
|
6127
|
-
function _isNativeReflectConstruct$
|
|
6088
|
+
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6128
6089
|
|
|
6129
|
-
function _createForOfIteratorHelper$
|
|
6090
|
+
function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6130
6091
|
|
|
6131
|
-
function _unsupportedIterableToArray$
|
|
6092
|
+
function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
|
|
6132
6093
|
|
|
6133
|
-
function _arrayLikeToArray$
|
|
6094
|
+
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
6134
6095
|
|
|
6135
6096
|
function findMatchedOption(authenticators, options) {
|
|
6136
6097
|
var option;
|
|
6137
6098
|
|
|
6138
|
-
var _iterator = _createForOfIteratorHelper$
|
|
6099
|
+
var _iterator = _createForOfIteratorHelper$2(authenticators),
|
|
6139
6100
|
_step;
|
|
6140
6101
|
|
|
6141
6102
|
try {
|
|
@@ -6168,32 +6129,17 @@ function findMatchedOption(authenticators, options) {
|
|
|
6168
6129
|
var SelectAuthenticator = /*#__PURE__*/function (_Remediator) {
|
|
6169
6130
|
_inherits(SelectAuthenticator, _Remediator);
|
|
6170
6131
|
|
|
6171
|
-
var _super = _createSuper$
|
|
6132
|
+
var _super = _createSuper$7(SelectAuthenticator);
|
|
6172
6133
|
|
|
6173
|
-
function SelectAuthenticator(
|
|
6134
|
+
function SelectAuthenticator() {
|
|
6174
6135
|
var _this;
|
|
6175
6136
|
|
|
6176
|
-
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6177
|
-
|
|
6178
6137
|
_classCallCheck(this, SelectAuthenticator);
|
|
6179
6138
|
|
|
6180
|
-
_this = _super.
|
|
6139
|
+
_this = _super.apply(this, arguments);
|
|
6181
6140
|
_this.map = {
|
|
6182
6141
|
authenticator: []
|
|
6183
6142
|
};
|
|
6184
|
-
var _this$values = _this.values,
|
|
6185
|
-
selectedAuthenticator = _this$values.authenticator,
|
|
6186
|
-
authenticators = _this$values.authenticators;
|
|
6187
|
-
var hasSelectedAuthenticatorInList = authenticators === null || authenticators === void 0 ? void 0 : authenticators.some(function (authenticator) {
|
|
6188
|
-
return authenticator.key === selectedAuthenticator;
|
|
6189
|
-
});
|
|
6190
|
-
|
|
6191
|
-
if (selectedAuthenticator && !hasSelectedAuthenticatorInList) {
|
|
6192
|
-
_this.values.authenticators = [].concat(_toConsumableArray(authenticators || []), [{
|
|
6193
|
-
key: selectedAuthenticator
|
|
6194
|
-
}]);
|
|
6195
|
-
}
|
|
6196
|
-
|
|
6197
6143
|
return _this;
|
|
6198
6144
|
}
|
|
6199
6145
|
|
|
@@ -6240,6 +6186,7 @@ var SelectAuthenticator = /*#__PURE__*/function (_Remediator) {
|
|
|
6240
6186
|
var authenticators = this.values.authenticators;
|
|
6241
6187
|
var options = remediationValue.options;
|
|
6242
6188
|
var selectedOption = findMatchedOption(authenticators, options);
|
|
6189
|
+
this.selectedAuthenticator = selectedOption.relatesTo;
|
|
6243
6190
|
return {
|
|
6244
6191
|
id: selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value.form.value.find(function (_ref2) {
|
|
6245
6192
|
var name = _ref2.name;
|
|
@@ -6255,36 +6202,67 @@ var SelectAuthenticator = /*#__PURE__*/function (_Remediator) {
|
|
|
6255
6202
|
key: 'string'
|
|
6256
6203
|
};
|
|
6257
6204
|
}
|
|
6205
|
+
}, {
|
|
6206
|
+
key: "getValuesAfterProceed",
|
|
6207
|
+
value: function getValuesAfterProceed() {
|
|
6208
|
+
var _this2 = this;
|
|
6209
|
+
|
|
6210
|
+
this.values = _get(_getPrototypeOf(SelectAuthenticator.prototype), "getValuesAfterProceed", this).call(this);
|
|
6211
|
+
var authenticators = this.values.authenticators.filter(function (authenticator) {
|
|
6212
|
+
return authenticator.key !== _this2.selectedAuthenticator.key;
|
|
6213
|
+
});
|
|
6214
|
+
return Object.assign(Object.assign({}, this.values), {
|
|
6215
|
+
authenticators: authenticators
|
|
6216
|
+
});
|
|
6217
|
+
}
|
|
6258
6218
|
}]);
|
|
6259
6219
|
|
|
6260
6220
|
return SelectAuthenticator;
|
|
6261
6221
|
}(Remediator);
|
|
6262
6222
|
|
|
6263
|
-
function _createSuper$
|
|
6223
|
+
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6264
6224
|
|
|
6265
|
-
function _isNativeReflectConstruct$
|
|
6225
|
+
function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6266
6226
|
var SelectAuthenticatorAuthenticate = /*#__PURE__*/function (_SelectAuthenticator) {
|
|
6267
6227
|
_inherits(SelectAuthenticatorAuthenticate, _SelectAuthenticator);
|
|
6268
6228
|
|
|
6269
|
-
var _super = _createSuper$
|
|
6229
|
+
var _super = _createSuper$6(SelectAuthenticatorAuthenticate);
|
|
6230
|
+
|
|
6231
|
+
function SelectAuthenticatorAuthenticate(remediation) {
|
|
6232
|
+
var _this;
|
|
6233
|
+
|
|
6234
|
+
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6270
6235
|
|
|
6271
|
-
function SelectAuthenticatorAuthenticate() {
|
|
6272
6236
|
_classCallCheck(this, SelectAuthenticatorAuthenticate);
|
|
6273
6237
|
|
|
6274
|
-
|
|
6238
|
+
var _a;
|
|
6239
|
+
|
|
6240
|
+
_this = _super.call(this, remediation, values);
|
|
6241
|
+
var hasPasswordInOptions = (_a = getAuthenticatorFromRemediation(remediation).options) === null || _a === void 0 ? void 0 : _a.some(function (_ref) {
|
|
6242
|
+
var relatesTo = _ref.relatesTo;
|
|
6243
|
+
return relatesTo.key === AuthenticatorKey.OKTA_PASSWORD;
|
|
6244
|
+
});
|
|
6245
|
+
|
|
6246
|
+
if (hasPasswordInOptions && (_this.values.flow === 'recoverPassword' || _this.values.password)) {
|
|
6247
|
+
_this.values.authenticators = [].concat(_toConsumableArray(_this.values.authenticators), [{
|
|
6248
|
+
key: AuthenticatorKey.OKTA_PASSWORD
|
|
6249
|
+
}]);
|
|
6250
|
+
}
|
|
6251
|
+
|
|
6252
|
+
return _this;
|
|
6275
6253
|
}
|
|
6276
6254
|
|
|
6277
6255
|
return SelectAuthenticatorAuthenticate;
|
|
6278
6256
|
}(SelectAuthenticator);
|
|
6279
6257
|
SelectAuthenticatorAuthenticate.remediationName = 'select-authenticator-authenticate';
|
|
6280
6258
|
|
|
6281
|
-
function _createSuper$
|
|
6259
|
+
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6282
6260
|
|
|
6283
|
-
function _isNativeReflectConstruct$
|
|
6261
|
+
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6284
6262
|
var SelectAuthenticatorEnroll = /*#__PURE__*/function (_SelectAuthenticator) {
|
|
6285
6263
|
_inherits(SelectAuthenticatorEnroll, _SelectAuthenticator);
|
|
6286
6264
|
|
|
6287
|
-
var _super = _createSuper$
|
|
6265
|
+
var _super = _createSuper$5(SelectAuthenticatorEnroll);
|
|
6288
6266
|
|
|
6289
6267
|
function SelectAuthenticatorEnroll() {
|
|
6290
6268
|
_classCallCheck(this, SelectAuthenticatorEnroll);
|
|
@@ -6296,13 +6274,13 @@ var SelectAuthenticatorEnroll = /*#__PURE__*/function (_SelectAuthenticator) {
|
|
|
6296
6274
|
}(SelectAuthenticator);
|
|
6297
6275
|
SelectAuthenticatorEnroll.remediationName = 'select-authenticator-enroll';
|
|
6298
6276
|
|
|
6299
|
-
function _createSuper$
|
|
6277
|
+
function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6300
6278
|
|
|
6301
|
-
function _isNativeReflectConstruct$
|
|
6279
|
+
function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6302
6280
|
var SelectEnrollProfile = /*#__PURE__*/function (_Remediator) {
|
|
6303
6281
|
_inherits(SelectEnrollProfile, _Remediator);
|
|
6304
6282
|
|
|
6305
|
-
var _super = _createSuper$
|
|
6283
|
+
var _super = _createSuper$4(SelectEnrollProfile);
|
|
6306
6284
|
|
|
6307
6285
|
function SelectEnrollProfile() {
|
|
6308
6286
|
_classCallCheck(this, SelectEnrollProfile);
|
|
@@ -6321,13 +6299,13 @@ var SelectEnrollProfile = /*#__PURE__*/function (_Remediator) {
|
|
|
6321
6299
|
}(Remediator);
|
|
6322
6300
|
SelectEnrollProfile.remediationName = 'select-enroll-profile';
|
|
6323
6301
|
|
|
6324
|
-
function _createSuper$
|
|
6302
|
+
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6325
6303
|
|
|
6326
|
-
function _isNativeReflectConstruct$
|
|
6304
|
+
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6327
6305
|
var AuthenticatorData = /*#__PURE__*/function (_Remediator) {
|
|
6328
6306
|
_inherits(AuthenticatorData, _Remediator);
|
|
6329
6307
|
|
|
6330
|
-
var _super = _createSuper$
|
|
6308
|
+
var _super = _createSuper$3(AuthenticatorData);
|
|
6331
6309
|
|
|
6332
6310
|
function AuthenticatorData(remediation) {
|
|
6333
6311
|
var _this;
|
|
@@ -6336,36 +6314,60 @@ var AuthenticatorData = /*#__PURE__*/function (_Remediator) {
|
|
|
6336
6314
|
|
|
6337
6315
|
_classCallCheck(this, AuthenticatorData);
|
|
6338
6316
|
|
|
6339
|
-
var _a;
|
|
6340
|
-
|
|
6341
6317
|
_this = _super.call(this, remediation, values);
|
|
6342
6318
|
_this.map = {
|
|
6343
6319
|
'authenticator': []
|
|
6344
6320
|
};
|
|
6345
|
-
|
|
6321
|
+
_this.authenticator = _this.getAuthenticator();
|
|
6346
6322
|
|
|
6347
|
-
|
|
6323
|
+
_this.formatAuthenticatorData();
|
|
6348
6324
|
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
});
|
|
6325
|
+
return _this;
|
|
6326
|
+
}
|
|
6352
6327
|
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6328
|
+
_createClass(AuthenticatorData, [{
|
|
6329
|
+
key: "formatAuthenticatorData",
|
|
6330
|
+
value: function formatAuthenticatorData() {
|
|
6331
|
+
var _this2 = this;
|
|
6332
|
+
|
|
6333
|
+
var authenticatorData = this.getAuthenticatorData();
|
|
6334
|
+
|
|
6335
|
+
if (authenticatorData) {
|
|
6336
|
+
this.values.authenticatorsData = this.values.authenticatorsData.map(function (data) {
|
|
6337
|
+
if (data.key === _this2.authenticator.key) {
|
|
6338
|
+
return _this2.mapAuthenticatorDataFromValues(data);
|
|
6339
|
+
}
|
|
6340
|
+
|
|
6341
|
+
return data;
|
|
6342
|
+
});
|
|
6343
|
+
} else {
|
|
6344
|
+
var data = this.mapAuthenticatorDataFromValues();
|
|
6345
|
+
|
|
6346
|
+
if (data) {
|
|
6347
|
+
this.values.authenticatorsData.push(data);
|
|
6357
6348
|
}
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
}, {
|
|
6352
|
+
key: "getAuthenticatorData",
|
|
6353
|
+
value: function getAuthenticatorData() {
|
|
6354
|
+
var _this3 = this;
|
|
6358
6355
|
|
|
6359
|
-
|
|
6356
|
+
return this.values.authenticatorsData.find(function (_ref) {
|
|
6357
|
+
var key = _ref.key;
|
|
6358
|
+
return key === _this3.authenticator.key;
|
|
6360
6359
|
});
|
|
6361
|
-
} else {
|
|
6362
|
-
_this.values.authenticators = [].concat(_toConsumableArray(authenticators), [_this.mapAuthenticatorFromValues()]);
|
|
6363
6360
|
}
|
|
6361
|
+
}, {
|
|
6362
|
+
key: "canRemediate",
|
|
6363
|
+
value: function canRemediate() {
|
|
6364
|
+
var _this4 = this;
|
|
6364
6365
|
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6366
|
+
return this.values.authenticatorsData.some(function (data) {
|
|
6367
|
+
return data.key === _this4.authenticator.key;
|
|
6368
|
+
});
|
|
6369
|
+
}
|
|
6370
|
+
}, {
|
|
6369
6371
|
key: "getNextStep",
|
|
6370
6372
|
value: function getNextStep() {
|
|
6371
6373
|
var common = _get(_getPrototypeOf(AuthenticatorData.prototype), "getNextStep", this).call(this);
|
|
@@ -6376,34 +6378,21 @@ var AuthenticatorData = /*#__PURE__*/function (_Remediator) {
|
|
|
6376
6378
|
});
|
|
6377
6379
|
}
|
|
6378
6380
|
}, {
|
|
6379
|
-
key: "
|
|
6380
|
-
value: function
|
|
6381
|
-
if (!this.values.authenticators) {
|
|
6382
|
-
return null;
|
|
6383
|
-
}
|
|
6384
|
-
|
|
6385
|
-
var authenticatorKey = this.getAuthenticator().key;
|
|
6386
|
-
var authenticator = this.values.authenticators.find(function (authenticator) {
|
|
6387
|
-
return authenticator.key === authenticatorKey;
|
|
6388
|
-
});
|
|
6389
|
-
return authenticator;
|
|
6390
|
-
}
|
|
6391
|
-
}, {
|
|
6392
|
-
key: "mapAuthenticatorFromValues",
|
|
6393
|
-
value: function mapAuthenticatorFromValues(authenticator) {
|
|
6394
|
-
var key = this.getAuthenticator().key;
|
|
6381
|
+
key: "mapAuthenticatorDataFromValues",
|
|
6382
|
+
value: function mapAuthenticatorDataFromValues(authenticatorData) {
|
|
6395
6383
|
var methodType = this.values.methodType;
|
|
6396
|
-
|
|
6397
|
-
key: key
|
|
6398
|
-
},
|
|
6384
|
+
var data = Object.assign(Object.assign({
|
|
6385
|
+
key: this.authenticator.key
|
|
6386
|
+
}, authenticatorData && authenticatorData), methodType && {
|
|
6399
6387
|
methodType: methodType
|
|
6400
6388
|
});
|
|
6389
|
+
return data.methodType ? data : null;
|
|
6401
6390
|
}
|
|
6402
6391
|
}, {
|
|
6403
6392
|
key: "getAuthenticatorFromRemediation",
|
|
6404
6393
|
value: function getAuthenticatorFromRemediation() {
|
|
6405
|
-
var authenticator = this.remediation.value.find(function (
|
|
6406
|
-
var name =
|
|
6394
|
+
var authenticator = this.remediation.value.find(function (_ref2) {
|
|
6395
|
+
var name = _ref2.name;
|
|
6407
6396
|
return name === 'authenticator';
|
|
6408
6397
|
});
|
|
6409
6398
|
return authenticator;
|
|
@@ -6414,23 +6403,36 @@ var AuthenticatorData = /*#__PURE__*/function (_Remediator) {
|
|
|
6414
6403
|
var _a;
|
|
6415
6404
|
|
|
6416
6405
|
var authenticator = this.getAuthenticatorFromRemediation();
|
|
6417
|
-
return (_a = authenticator.form.value.find(function (
|
|
6418
|
-
var name =
|
|
6406
|
+
return (_a = authenticator.form.value.find(function (_ref3) {
|
|
6407
|
+
var name = _ref3.name;
|
|
6419
6408
|
return name === 'methodType';
|
|
6420
6409
|
})) === null || _a === void 0 ? void 0 : _a.options;
|
|
6421
6410
|
}
|
|
6411
|
+
}, {
|
|
6412
|
+
key: "getValuesAfterProceed",
|
|
6413
|
+
value: function getValuesAfterProceed() {
|
|
6414
|
+
var _this5 = this;
|
|
6415
|
+
|
|
6416
|
+
this.values = _get(_getPrototypeOf(AuthenticatorData.prototype), "getValuesAfterProceed", this).call(this);
|
|
6417
|
+
var authenticatorsData = this.values.authenticatorsData.filter(function (data) {
|
|
6418
|
+
return data.key !== _this5.authenticator.key;
|
|
6419
|
+
});
|
|
6420
|
+
return Object.assign(Object.assign({}, this.values), {
|
|
6421
|
+
authenticatorsData: authenticatorsData
|
|
6422
|
+
});
|
|
6423
|
+
}
|
|
6422
6424
|
}]);
|
|
6423
6425
|
|
|
6424
6426
|
return AuthenticatorData;
|
|
6425
6427
|
}(Remediator);
|
|
6426
6428
|
|
|
6427
|
-
function _createSuper$
|
|
6429
|
+
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6428
6430
|
|
|
6429
|
-
function _isNativeReflectConstruct$
|
|
6431
|
+
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6430
6432
|
var AuthenticatorVerificationData = /*#__PURE__*/function (_AuthenticatorData) {
|
|
6431
6433
|
_inherits(AuthenticatorVerificationData, _AuthenticatorData);
|
|
6432
6434
|
|
|
6433
|
-
var _super = _createSuper$
|
|
6435
|
+
var _super = _createSuper$2(AuthenticatorVerificationData);
|
|
6434
6436
|
|
|
6435
6437
|
function AuthenticatorVerificationData() {
|
|
6436
6438
|
_classCallCheck(this, AuthenticatorVerificationData);
|
|
@@ -6439,26 +6441,22 @@ var AuthenticatorVerificationData = /*#__PURE__*/function (_AuthenticatorData) {
|
|
|
6439
6441
|
}
|
|
6440
6442
|
|
|
6441
6443
|
_createClass(AuthenticatorVerificationData, [{
|
|
6442
|
-
key: "canRemediate",
|
|
6443
|
-
value: function canRemediate() {
|
|
6444
|
-
var authenticator = this.getAuthenticatorFromValues();
|
|
6445
|
-
return !!(authenticator && authenticator.methodType);
|
|
6446
|
-
}
|
|
6447
|
-
}, {
|
|
6448
6444
|
key: "mapAuthenticator",
|
|
6449
6445
|
value: function mapAuthenticator() {
|
|
6446
|
+
var _a;
|
|
6447
|
+
|
|
6448
|
+
var authenticatorData = this.getAuthenticatorData();
|
|
6450
6449
|
var authenticatorFromRemediation = this.getAuthenticatorFromRemediation();
|
|
6451
|
-
var authenticatorFromValues = this.getAuthenticatorFromValues();
|
|
6452
6450
|
return {
|
|
6453
6451
|
id: authenticatorFromRemediation.form.value.find(function (_ref) {
|
|
6454
6452
|
var name = _ref.name;
|
|
6455
6453
|
return name === 'id';
|
|
6456
6454
|
}).value,
|
|
6457
|
-
enrollmentId: authenticatorFromRemediation.form.value.find(function (_ref2) {
|
|
6455
|
+
enrollmentId: (_a = authenticatorFromRemediation.form.value.find(function (_ref2) {
|
|
6458
6456
|
var name = _ref2.name;
|
|
6459
6457
|
return name === 'enrollmentId';
|
|
6460
|
-
}).value,
|
|
6461
|
-
methodType:
|
|
6458
|
+
})) === null || _a === void 0 ? void 0 : _a.value,
|
|
6459
|
+
methodType: authenticatorData.methodType
|
|
6462
6460
|
};
|
|
6463
6461
|
}
|
|
6464
6462
|
}, {
|
|
@@ -6470,128 +6468,450 @@ var AuthenticatorVerificationData = /*#__PURE__*/function (_AuthenticatorData) {
|
|
|
6470
6468
|
return name === 'methodType';
|
|
6471
6469
|
});
|
|
6472
6470
|
|
|
6473
|
-
if (methodType && methodType.options) {
|
|
6474
|
-
return {
|
|
6475
|
-
name: 'methodType',
|
|
6476
|
-
type: 'string',
|
|
6477
|
-
required: true
|
|
6478
|
-
};
|
|
6479
|
-
}
|
|
6471
|
+
if (methodType && methodType.options) {
|
|
6472
|
+
return {
|
|
6473
|
+
name: 'methodType',
|
|
6474
|
+
type: 'string',
|
|
6475
|
+
required: true
|
|
6476
|
+
};
|
|
6477
|
+
}
|
|
6478
|
+
|
|
6479
|
+
var inputs = _toConsumableArray(authenticator.form.value);
|
|
6480
|
+
|
|
6481
|
+
return inputs;
|
|
6482
|
+
}
|
|
6483
|
+
}]);
|
|
6484
|
+
|
|
6485
|
+
return AuthenticatorVerificationData;
|
|
6486
|
+
}(AuthenticatorData);
|
|
6487
|
+
AuthenticatorVerificationData.remediationName = 'authenticator-verification-data';
|
|
6488
|
+
|
|
6489
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6490
|
+
|
|
6491
|
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6492
|
+
var AuthenticatorEnrollmentData = /*#__PURE__*/function (_AuthenticatorData) {
|
|
6493
|
+
_inherits(AuthenticatorEnrollmentData, _AuthenticatorData);
|
|
6494
|
+
|
|
6495
|
+
var _super = _createSuper$1(AuthenticatorEnrollmentData);
|
|
6496
|
+
|
|
6497
|
+
function AuthenticatorEnrollmentData() {
|
|
6498
|
+
_classCallCheck(this, AuthenticatorEnrollmentData);
|
|
6499
|
+
|
|
6500
|
+
return _super.apply(this, arguments);
|
|
6501
|
+
}
|
|
6502
|
+
|
|
6503
|
+
_createClass(AuthenticatorEnrollmentData, [{
|
|
6504
|
+
key: "mapAuthenticator",
|
|
6505
|
+
value: function mapAuthenticator() {
|
|
6506
|
+
var authenticatorData = this.getAuthenticatorData();
|
|
6507
|
+
var authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);
|
|
6508
|
+
return {
|
|
6509
|
+
id: authenticatorFromRemediation.form.value.find(function (_ref) {
|
|
6510
|
+
var name = _ref.name;
|
|
6511
|
+
return name === 'id';
|
|
6512
|
+
}).value,
|
|
6513
|
+
methodType: authenticatorData.methodType,
|
|
6514
|
+
phoneNumber: authenticatorData.phoneNumber
|
|
6515
|
+
};
|
|
6516
|
+
}
|
|
6517
|
+
}, {
|
|
6518
|
+
key: "getInputAuthenticator",
|
|
6519
|
+
value: function getInputAuthenticator() {
|
|
6520
|
+
return [{
|
|
6521
|
+
name: 'methodType',
|
|
6522
|
+
type: 'string',
|
|
6523
|
+
required: true
|
|
6524
|
+
}, {
|
|
6525
|
+
name: 'phoneNumber',
|
|
6526
|
+
type: 'string',
|
|
6527
|
+
required: true,
|
|
6528
|
+
label: 'Phone Number'
|
|
6529
|
+
}];
|
|
6530
|
+
}
|
|
6531
|
+
}, {
|
|
6532
|
+
key: "mapAuthenticatorDataFromValues",
|
|
6533
|
+
value: function mapAuthenticatorDataFromValues(data) {
|
|
6534
|
+
data = _get(_getPrototypeOf(AuthenticatorEnrollmentData.prototype), "mapAuthenticatorDataFromValues", this).call(this, data);
|
|
6535
|
+
var phoneNumber = this.values.phoneNumber;
|
|
6536
|
+
data = Object.assign(Object.assign({}, data && data), phoneNumber && {
|
|
6537
|
+
phoneNumber: phoneNumber
|
|
6538
|
+
});
|
|
6539
|
+
return data.phoneNumber && data.methodType ? data : null;
|
|
6540
|
+
}
|
|
6541
|
+
}]);
|
|
6542
|
+
|
|
6543
|
+
return AuthenticatorEnrollmentData;
|
|
6544
|
+
}(AuthenticatorData);
|
|
6545
|
+
AuthenticatorEnrollmentData.remediationName = 'authenticator-enrollment-data';
|
|
6546
|
+
|
|
6547
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6548
|
+
|
|
6549
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6550
|
+
var Skip = /*#__PURE__*/function (_Remediator) {
|
|
6551
|
+
_inherits(Skip, _Remediator);
|
|
6552
|
+
|
|
6553
|
+
var _super = _createSuper(Skip);
|
|
6554
|
+
|
|
6555
|
+
function Skip() {
|
|
6556
|
+
var _this;
|
|
6557
|
+
|
|
6558
|
+
_classCallCheck(this, Skip);
|
|
6559
|
+
|
|
6560
|
+
_this = _super.apply(this, arguments);
|
|
6561
|
+
_this.map = {
|
|
6562
|
+
skip: ['skip']
|
|
6563
|
+
};
|
|
6564
|
+
return _this;
|
|
6565
|
+
}
|
|
6566
|
+
|
|
6567
|
+
_createClass(Skip, [{
|
|
6568
|
+
key: "canRemediate",
|
|
6569
|
+
value: function canRemediate() {
|
|
6570
|
+
return !!this.values.skip;
|
|
6571
|
+
}
|
|
6572
|
+
}]);
|
|
6573
|
+
|
|
6574
|
+
return Skip;
|
|
6575
|
+
}(Remediator);
|
|
6576
|
+
Skip.remediationName = 'skip';
|
|
6577
|
+
|
|
6578
|
+
var remediators = /*#__PURE__*/Object.freeze({
|
|
6579
|
+
__proto__: null,
|
|
6580
|
+
Remediator: Remediator,
|
|
6581
|
+
EnrollAuthenticator: EnrollAuthenticator,
|
|
6582
|
+
EnrollPoll: EnrollPoll,
|
|
6583
|
+
ChallengeAuthenticator: ChallengeAuthenticator,
|
|
6584
|
+
ChallengePoll: ChallengePoll,
|
|
6585
|
+
ResetAuthenticator: ResetAuthenticator,
|
|
6586
|
+
EnrollProfile: EnrollProfile,
|
|
6587
|
+
Identify: Identify,
|
|
6588
|
+
ReEnrollAuthenticator: ReEnrollAuthenticator,
|
|
6589
|
+
RedirectIdp: RedirectIdp,
|
|
6590
|
+
SelectAuthenticatorAuthenticate: SelectAuthenticatorAuthenticate,
|
|
6591
|
+
SelectAuthenticatorEnroll: SelectAuthenticatorEnroll,
|
|
6592
|
+
SelectEnrollProfile: SelectEnrollProfile,
|
|
6593
|
+
AuthenticatorVerificationData: AuthenticatorVerificationData,
|
|
6594
|
+
AuthenticatorEnrollmentData: AuthenticatorEnrollmentData,
|
|
6595
|
+
Skip: Skip
|
|
6596
|
+
});
|
|
6597
|
+
|
|
6598
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6599
|
+
|
|
6600
|
+
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
|
6601
|
+
|
|
6602
|
+
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
6603
|
+
function getRemediator(idxRemediations, values, options) {
|
|
6604
|
+
var remediators = options.remediators;
|
|
6605
|
+
var remediator;
|
|
6606
|
+
var remediatorCandidates = [];
|
|
6607
|
+
|
|
6608
|
+
var _iterator = _createForOfIteratorHelper$1(idxRemediations),
|
|
6609
|
+
_step;
|
|
6610
|
+
|
|
6611
|
+
try {
|
|
6612
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6613
|
+
var remediation = _step.value;
|
|
6614
|
+
var isRemeditionInFlow = Object.keys(remediators).includes(remediation.name);
|
|
6615
|
+
|
|
6616
|
+
if (!isRemeditionInFlow) {
|
|
6617
|
+
continue;
|
|
6618
|
+
}
|
|
6619
|
+
|
|
6620
|
+
var T = remediators[remediation.name];
|
|
6621
|
+
remediator = new T(remediation, values);
|
|
6622
|
+
|
|
6623
|
+
if (remediator.canRemediate()) {
|
|
6624
|
+
return remediator;
|
|
6625
|
+
}
|
|
6626
|
+
|
|
6627
|
+
remediatorCandidates.push(remediator);
|
|
6628
|
+
}
|
|
6629
|
+
} catch (err) {
|
|
6630
|
+
_iterator.e(err);
|
|
6631
|
+
} finally {
|
|
6632
|
+
_iterator.f();
|
|
6633
|
+
}
|
|
6634
|
+
|
|
6635
|
+
return remediatorCandidates[0];
|
|
6636
|
+
}
|
|
6637
|
+
|
|
6638
|
+
function isTerminalResponse(idxResponse) {
|
|
6639
|
+
var neededToProceed = idxResponse.neededToProceed,
|
|
6640
|
+
interactionCode = idxResponse.interactionCode;
|
|
6641
|
+
return !neededToProceed.length && !interactionCode;
|
|
6642
|
+
}
|
|
6643
|
+
|
|
6644
|
+
function canSkipFn(idxResponse) {
|
|
6645
|
+
return idxResponse.neededToProceed.some(function (_ref) {
|
|
6646
|
+
var name = _ref.name;
|
|
6647
|
+
return name === 'skip';
|
|
6648
|
+
});
|
|
6649
|
+
}
|
|
6650
|
+
|
|
6651
|
+
function canResendFn(idxResponse) {
|
|
6652
|
+
return Object.keys(idxResponse.actions).some(function (actionName) {
|
|
6653
|
+
return actionName.includes('resend');
|
|
6654
|
+
});
|
|
6655
|
+
}
|
|
6656
|
+
|
|
6657
|
+
function getIdxMessages(idxResponse) {
|
|
6658
|
+
var _a;
|
|
6659
|
+
|
|
6660
|
+
var messages = [];
|
|
6661
|
+
var rawIdxState = idxResponse.rawIdxState,
|
|
6662
|
+
neededToProceed = idxResponse.neededToProceed;
|
|
6663
|
+
var globalMessages = (_a = rawIdxState.messages) === null || _a === void 0 ? void 0 : _a.value.map(function (message) {
|
|
6664
|
+
return message;
|
|
6665
|
+
});
|
|
6666
|
+
|
|
6667
|
+
if (globalMessages) {
|
|
6668
|
+
messages = [].concat(_toConsumableArray(messages), _toConsumableArray(globalMessages));
|
|
6669
|
+
}
|
|
6670
|
+
|
|
6671
|
+
var _iterator2 = _createForOfIteratorHelper$1(neededToProceed),
|
|
6672
|
+
_step2;
|
|
6673
|
+
|
|
6674
|
+
try {
|
|
6675
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
6676
|
+
var remediation = _step2.value;
|
|
6677
|
+
var fieldMessages = Remediator.getMessages(remediation);
|
|
6678
|
+
|
|
6679
|
+
if (fieldMessages) {
|
|
6680
|
+
messages = [].concat(_toConsumableArray(messages), _toConsumableArray(fieldMessages));
|
|
6681
|
+
}
|
|
6682
|
+
}
|
|
6683
|
+
} catch (err) {
|
|
6684
|
+
_iterator2.e(err);
|
|
6685
|
+
} finally {
|
|
6686
|
+
_iterator2.f();
|
|
6687
|
+
}
|
|
6688
|
+
|
|
6689
|
+
return messages;
|
|
6690
|
+
}
|
|
6691
|
+
|
|
6692
|
+
function getNextStep(remediator, idxResponse) {
|
|
6693
|
+
var nextStep = remediator.getNextStep(idxResponse.context);
|
|
6694
|
+
var canSkip = canSkipFn(idxResponse);
|
|
6695
|
+
var canResend = canResendFn(idxResponse);
|
|
6696
|
+
return Object.assign(Object.assign(Object.assign({}, nextStep), canSkip && {
|
|
6697
|
+
canSkip: canSkip
|
|
6698
|
+
}), canResend && {
|
|
6699
|
+
canResend: canResend
|
|
6700
|
+
});
|
|
6701
|
+
}
|
|
6702
|
+
|
|
6703
|
+
function handleIdxError(e, remediator) {
|
|
6704
|
+
var idxState = isIdxResponse(e) ? e : null;
|
|
6705
|
+
|
|
6706
|
+
if (!idxState) {
|
|
6707
|
+
throw e;
|
|
6708
|
+
}
|
|
6709
|
+
|
|
6710
|
+
var terminal = isTerminalResponse(idxState);
|
|
6711
|
+
var messages = getIdxMessages(idxState);
|
|
6712
|
+
|
|
6713
|
+
if (terminal) {
|
|
6714
|
+
return {
|
|
6715
|
+
terminal: terminal,
|
|
6716
|
+
messages: messages
|
|
6717
|
+
};
|
|
6718
|
+
} else {
|
|
6719
|
+
var nextStep = remediator && getNextStep(remediator, idxState);
|
|
6720
|
+
return Object.assign({
|
|
6721
|
+
messages: messages
|
|
6722
|
+
}, nextStep && {
|
|
6723
|
+
nextStep: nextStep
|
|
6724
|
+
});
|
|
6725
|
+
}
|
|
6726
|
+
}
|
|
6727
|
+
|
|
6728
|
+
function getActionFromValues(values, idxResponse) {
|
|
6729
|
+
return Object.keys(idxResponse.actions).find(function (action) {
|
|
6730
|
+
return !!values.resend && action.includes('-resend');
|
|
6731
|
+
});
|
|
6732
|
+
}
|
|
6733
|
+
|
|
6734
|
+
function removeActionFromValues(values) {
|
|
6735
|
+
values.resend = undefined;
|
|
6736
|
+
return values;
|
|
6737
|
+
}
|
|
6738
|
+
|
|
6739
|
+
function remediate(_x, _x2, _x3) {
|
|
6740
|
+
return _remediate.apply(this, arguments);
|
|
6741
|
+
}
|
|
6742
|
+
|
|
6743
|
+
function _remediate() {
|
|
6744
|
+
_remediate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(idxResponse, values, options) {
|
|
6745
|
+
var _idxResponse, neededToProceed, interactionCode, remediators, terminal, messages, remediator, nextStep, actionFromValues, actions, _iterator3, _step3, action, valuesWithoutExecutedAction, _nextStep, name, data;
|
|
6746
|
+
|
|
6747
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6748
|
+
while (1) {
|
|
6749
|
+
switch (_context.prev = _context.next) {
|
|
6750
|
+
case 0:
|
|
6751
|
+
_idxResponse = idxResponse, neededToProceed = _idxResponse.neededToProceed, interactionCode = _idxResponse.interactionCode;
|
|
6752
|
+
remediators = options.remediators;
|
|
6753
|
+
|
|
6754
|
+
if (!interactionCode) {
|
|
6755
|
+
_context.next = 4;
|
|
6756
|
+
break;
|
|
6757
|
+
}
|
|
6758
|
+
|
|
6759
|
+
return _context.abrupt("return", {
|
|
6760
|
+
idxResponse: idxResponse
|
|
6761
|
+
});
|
|
6762
|
+
|
|
6763
|
+
case 4:
|
|
6764
|
+
terminal = isTerminalResponse(idxResponse);
|
|
6765
|
+
messages = getIdxMessages(idxResponse);
|
|
6766
|
+
|
|
6767
|
+
if (!terminal) {
|
|
6768
|
+
_context.next = 8;
|
|
6769
|
+
break;
|
|
6770
|
+
}
|
|
6771
|
+
|
|
6772
|
+
return _context.abrupt("return", {
|
|
6773
|
+
terminal: terminal,
|
|
6774
|
+
messages: messages
|
|
6775
|
+
});
|
|
6776
|
+
|
|
6777
|
+
case 8:
|
|
6778
|
+
remediator = getRemediator(neededToProceed, values, options);
|
|
6779
|
+
|
|
6780
|
+
if (remediator) {
|
|
6781
|
+
_context.next = 11;
|
|
6782
|
+
break;
|
|
6783
|
+
}
|
|
6784
|
+
|
|
6785
|
+
throw new AuthSdkError("\n No remediation can match current flow, check policy settings in your org.\n Remediations: [".concat(neededToProceed.reduce(function (acc, curr) {
|
|
6786
|
+
return acc ? acc + ' ,' + curr.name : curr.name;
|
|
6787
|
+
}, ''), "]\n "));
|
|
6788
|
+
|
|
6789
|
+
case 11:
|
|
6790
|
+
if (!messages.length) {
|
|
6791
|
+
_context.next = 14;
|
|
6792
|
+
break;
|
|
6793
|
+
}
|
|
6794
|
+
|
|
6795
|
+
nextStep = getNextStep(remediator, idxResponse);
|
|
6796
|
+
return _context.abrupt("return", {
|
|
6797
|
+
nextStep: nextStep,
|
|
6798
|
+
messages: messages
|
|
6799
|
+
});
|
|
6800
|
+
|
|
6801
|
+
case 14:
|
|
6802
|
+
actionFromValues = getActionFromValues(values, idxResponse);
|
|
6803
|
+
actions = [].concat(_toConsumableArray(options.actions || []), _toConsumableArray(actionFromValues && [actionFromValues] || []));
|
|
6804
|
+
|
|
6805
|
+
if (!actions) {
|
|
6806
|
+
_context.next = 46;
|
|
6807
|
+
break;
|
|
6808
|
+
}
|
|
6480
6809
|
|
|
6481
|
-
|
|
6810
|
+
_iterator3 = _createForOfIteratorHelper$1(actions);
|
|
6811
|
+
_context.prev = 18;
|
|
6482
6812
|
|
|
6483
|
-
|
|
6484
|
-
}
|
|
6485
|
-
}]);
|
|
6813
|
+
_iterator3.s();
|
|
6486
6814
|
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6815
|
+
case 20:
|
|
6816
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
6817
|
+
_context.next = 38;
|
|
6818
|
+
break;
|
|
6819
|
+
}
|
|
6490
6820
|
|
|
6491
|
-
|
|
6821
|
+
action = _step3.value;
|
|
6822
|
+
valuesWithoutExecutedAction = removeActionFromValues(values);
|
|
6492
6823
|
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6824
|
+
if (!(typeof idxResponse.actions[action] === 'function')) {
|
|
6825
|
+
_context.next = 36;
|
|
6826
|
+
break;
|
|
6827
|
+
}
|
|
6496
6828
|
|
|
6497
|
-
|
|
6829
|
+
_context.prev = 24;
|
|
6830
|
+
_context.next = 27;
|
|
6831
|
+
return idxResponse.actions[action]();
|
|
6498
6832
|
|
|
6499
|
-
|
|
6500
|
-
|
|
6833
|
+
case 27:
|
|
6834
|
+
idxResponse = _context.sent;
|
|
6835
|
+
_context.next = 33;
|
|
6836
|
+
break;
|
|
6501
6837
|
|
|
6502
|
-
|
|
6503
|
-
|
|
6838
|
+
case 30:
|
|
6839
|
+
_context.prev = 30;
|
|
6840
|
+
_context.t0 = _context["catch"](24);
|
|
6841
|
+
return _context.abrupt("return", handleIdxError(_context.t0, remediators));
|
|
6504
6842
|
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
}
|
|
6511
|
-
}, {
|
|
6512
|
-
key: "mapAuthenticator",
|
|
6513
|
-
value: function mapAuthenticator() {
|
|
6514
|
-
var authenticatorFromValues = this.getAuthenticatorFromValues();
|
|
6515
|
-
var authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);
|
|
6516
|
-
return {
|
|
6517
|
-
id: authenticatorFromRemediation.form.value.find(function (_ref) {
|
|
6518
|
-
var name = _ref.name;
|
|
6519
|
-
return name === 'id';
|
|
6520
|
-
}).value,
|
|
6521
|
-
methodType: authenticatorFromValues.methodType,
|
|
6522
|
-
phoneNumber: authenticatorFromValues.phoneNumber
|
|
6523
|
-
};
|
|
6524
|
-
}
|
|
6525
|
-
}, {
|
|
6526
|
-
key: "getInputAuthenticator",
|
|
6527
|
-
value: function getInputAuthenticator() {
|
|
6528
|
-
return [{
|
|
6529
|
-
name: 'methodType',
|
|
6530
|
-
type: 'string',
|
|
6531
|
-
required: true
|
|
6532
|
-
}, {
|
|
6533
|
-
name: 'phoneNumber',
|
|
6534
|
-
type: 'string',
|
|
6535
|
-
required: true
|
|
6536
|
-
}];
|
|
6537
|
-
}
|
|
6538
|
-
}, {
|
|
6539
|
-
key: "mapAuthenticatorFromValues",
|
|
6540
|
-
value: function mapAuthenticatorFromValues(authenticator) {
|
|
6541
|
-
authenticator = _get(_getPrototypeOf(AuthenticatorEnrollmentData.prototype), "mapAuthenticatorFromValues", this).call(this, authenticator);
|
|
6542
|
-
var phoneNumber = this.values.phoneNumber;
|
|
6543
|
-
return Object.assign(Object.assign({}, authenticator), phoneNumber && {
|
|
6544
|
-
phoneNumber: phoneNumber
|
|
6545
|
-
});
|
|
6546
|
-
}
|
|
6547
|
-
}]);
|
|
6843
|
+
case 33:
|
|
6844
|
+
if (!(action === 'cancel')) {
|
|
6845
|
+
_context.next = 35;
|
|
6846
|
+
break;
|
|
6847
|
+
}
|
|
6548
6848
|
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6849
|
+
return _context.abrupt("return", {
|
|
6850
|
+
canceled: true
|
|
6851
|
+
});
|
|
6552
6852
|
|
|
6553
|
-
|
|
6853
|
+
case 35:
|
|
6854
|
+
return _context.abrupt("return", remediate(idxResponse, valuesWithoutExecutedAction, options));
|
|
6554
6855
|
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6856
|
+
case 36:
|
|
6857
|
+
_context.next = 20;
|
|
6858
|
+
break;
|
|
6558
6859
|
|
|
6559
|
-
|
|
6860
|
+
case 38:
|
|
6861
|
+
_context.next = 43;
|
|
6862
|
+
break;
|
|
6560
6863
|
|
|
6561
|
-
|
|
6562
|
-
|
|
6864
|
+
case 40:
|
|
6865
|
+
_context.prev = 40;
|
|
6866
|
+
_context.t1 = _context["catch"](18);
|
|
6563
6867
|
|
|
6564
|
-
|
|
6565
|
-
}
|
|
6868
|
+
_iterator3.e(_context.t1);
|
|
6566
6869
|
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
value: function canRemediate() {
|
|
6570
|
-
return !!this.values.skip;
|
|
6571
|
-
}
|
|
6572
|
-
}]);
|
|
6870
|
+
case 43:
|
|
6871
|
+
_context.prev = 43;
|
|
6573
6872
|
|
|
6574
|
-
|
|
6575
|
-
}(Remediator);
|
|
6576
|
-
Skip.remediationName = 'skip';
|
|
6873
|
+
_iterator3.f();
|
|
6577
6874
|
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6875
|
+
return _context.finish(43);
|
|
6876
|
+
|
|
6877
|
+
case 46:
|
|
6878
|
+
if (remediator.canRemediate()) {
|
|
6879
|
+
_context.next = 49;
|
|
6880
|
+
break;
|
|
6881
|
+
}
|
|
6882
|
+
|
|
6883
|
+
_nextStep = getNextStep(remediator, idxResponse);
|
|
6884
|
+
return _context.abrupt("return", {
|
|
6885
|
+
idxResponse: idxResponse,
|
|
6886
|
+
nextStep: _nextStep
|
|
6887
|
+
});
|
|
6888
|
+
|
|
6889
|
+
case 49:
|
|
6890
|
+
name = remediator.getName();
|
|
6891
|
+
data = remediator.getData();
|
|
6892
|
+
_context.prev = 51;
|
|
6893
|
+
_context.next = 54;
|
|
6894
|
+
return idxResponse.proceed(name, data);
|
|
6895
|
+
|
|
6896
|
+
case 54:
|
|
6897
|
+
idxResponse = _context.sent;
|
|
6898
|
+
values = remediator.getValuesAfterProceed();
|
|
6899
|
+
return _context.abrupt("return", remediate(idxResponse, values, options));
|
|
6900
|
+
|
|
6901
|
+
case 59:
|
|
6902
|
+
_context.prev = 59;
|
|
6903
|
+
_context.t2 = _context["catch"](51);
|
|
6904
|
+
return _context.abrupt("return", handleIdxError(_context.t2, remediator));
|
|
6905
|
+
|
|
6906
|
+
case 62:
|
|
6907
|
+
case "end":
|
|
6908
|
+
return _context.stop();
|
|
6909
|
+
}
|
|
6910
|
+
}
|
|
6911
|
+
}, _callee, null, [[18, 40, 43, 46], [24, 30], [51, 59]]);
|
|
6912
|
+
}));
|
|
6913
|
+
return _remediate.apply(this, arguments);
|
|
6914
|
+
}
|
|
6595
6915
|
|
|
6596
6916
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6597
6917
|
|
|
@@ -6747,7 +7067,7 @@ function _run() {
|
|
|
6747
7067
|
meta = metaFromResp;
|
|
6748
7068
|
enabledFeatures = getEnabledFeatures(idxResponse);
|
|
6749
7069
|
availableSteps = getAvailableSteps(idxResponse.neededToProceed);
|
|
6750
|
-
_context.next =
|
|
7070
|
+
_context.next = 49;
|
|
6751
7071
|
break;
|
|
6752
7072
|
|
|
6753
7073
|
case 24:
|
|
@@ -6783,29 +7103,17 @@ function _run() {
|
|
|
6783
7103
|
|
|
6784
7104
|
status = IdxStatus.CANCELED;
|
|
6785
7105
|
shouldClearTransaction = true;
|
|
6786
|
-
_context.next =
|
|
7106
|
+
_context.next = 49;
|
|
6787
7107
|
break;
|
|
6788
7108
|
|
|
6789
7109
|
case 42:
|
|
6790
7110
|
if (!(idxResponseFromResp === null || idxResponseFromResp === void 0 ? void 0 : idxResponseFromResp.interactionCode)) {
|
|
6791
|
-
_context.next =
|
|
6792
|
-
break;
|
|
6793
|
-
}
|
|
6794
|
-
|
|
6795
|
-
_context.next = 45;
|
|
6796
|
-
return options.flowMonitor.isFinished();
|
|
6797
|
-
|
|
6798
|
-
case 45:
|
|
6799
|
-
if (_context.sent) {
|
|
6800
|
-
_context.next = 47;
|
|
7111
|
+
_context.next = 49;
|
|
6801
7112
|
break;
|
|
6802
7113
|
}
|
|
6803
7114
|
|
|
6804
|
-
throw new AuthSdkError('Current flow is not supported, check policy settings in your org.');
|
|
6805
|
-
|
|
6806
|
-
case 47:
|
|
6807
7115
|
_metaFromResp = metaFromResp, clientId = _metaFromResp.clientId, codeVerifier = _metaFromResp.codeVerifier, ignoreSignature = _metaFromResp.ignoreSignature, redirectUri = _metaFromResp.redirectUri, urls = _metaFromResp.urls, scopes = _metaFromResp.scopes;
|
|
6808
|
-
_context.next =
|
|
7116
|
+
_context.next = 46;
|
|
6809
7117
|
return authClient.token.exchangeCodeForTokens({
|
|
6810
7118
|
interactionCode: idxResponseFromResp.interactionCode,
|
|
6811
7119
|
clientId: clientId,
|
|
@@ -6815,23 +7123,23 @@ function _run() {
|
|
|
6815
7123
|
scopes: scopes
|
|
6816
7124
|
}, urls);
|
|
6817
7125
|
|
|
6818
|
-
case
|
|
7126
|
+
case 46:
|
|
6819
7127
|
tokens = _context.sent;
|
|
6820
7128
|
status = IdxStatus.SUCCESS;
|
|
6821
7129
|
shouldClearTransaction = true;
|
|
6822
7130
|
|
|
6823
|
-
case
|
|
6824
|
-
_context.next =
|
|
7131
|
+
case 49:
|
|
7132
|
+
_context.next = 56;
|
|
6825
7133
|
break;
|
|
6826
7134
|
|
|
6827
|
-
case
|
|
6828
|
-
_context.prev =
|
|
7135
|
+
case 51:
|
|
7136
|
+
_context.prev = 51;
|
|
6829
7137
|
_context.t0 = _context["catch"](3);
|
|
6830
7138
|
error = _context.t0;
|
|
6831
7139
|
status = IdxStatus.FAILURE;
|
|
6832
7140
|
shouldClearTransaction = true;
|
|
6833
7141
|
|
|
6834
|
-
case
|
|
7142
|
+
case 56:
|
|
6835
7143
|
if (shouldClearTransaction) {
|
|
6836
7144
|
authClient.transactionManager.clear();
|
|
6837
7145
|
}
|
|
@@ -6847,160 +7155,38 @@ function _run() {
|
|
|
6847
7155
|
availableSteps: availableSteps
|
|
6848
7156
|
}), tokens && {
|
|
6849
7157
|
tokens: tokens.tokens
|
|
6850
|
-
}), nextStep && {
|
|
6851
|
-
nextStep: nextStep
|
|
6852
|
-
}), messages && {
|
|
6853
|
-
messages: messages
|
|
6854
|
-
}), error && {
|
|
6855
|
-
error: error
|
|
6856
|
-
}));
|
|
6857
|
-
|
|
6858
|
-
case 62:
|
|
6859
|
-
case "end":
|
|
6860
|
-
return _context.stop();
|
|
6861
|
-
}
|
|
6862
|
-
}
|
|
6863
|
-
}, _callee, null, [[3, 55]]);
|
|
6864
|
-
}));
|
|
6865
|
-
return _run.apply(this, arguments);
|
|
6866
|
-
}
|
|
6867
|
-
|
|
6868
|
-
var AuthenticationFlow = {
|
|
6869
|
-
'identify': Identify,
|
|
6870
|
-
'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,
|
|
6871
|
-
'select-authenticator-enroll': SelectAuthenticatorEnroll,
|
|
6872
|
-
'authenticator-enrollment-data': AuthenticatorEnrollmentData,
|
|
6873
|
-
'authenticator-verification-data': AuthenticatorVerificationData,
|
|
6874
|
-
'enroll-authenticator': EnrollAuthenticator,
|
|
6875
|
-
'challenge-authenticator': ChallengeAuthenticator,
|
|
6876
|
-
'reenroll-authenticator': ReEnrollAuthenticator,
|
|
6877
|
-
'redirect-idp': RedirectIdp
|
|
6878
|
-
};
|
|
6879
|
-
|
|
6880
|
-
var FlowMonitor = /*#__PURE__*/function () {
|
|
6881
|
-
function FlowMonitor(authClient) {
|
|
6882
|
-
_classCallCheck(this, FlowMonitor);
|
|
6883
|
-
|
|
6884
|
-
this.authClient = authClient;
|
|
6885
|
-
}
|
|
6886
|
-
|
|
6887
|
-
_createClass(FlowMonitor, [{
|
|
6888
|
-
key: "loopDetected",
|
|
6889
|
-
value: function loopDetected(remediator) {
|
|
6890
|
-
if (!this.previousRemediator) {
|
|
6891
|
-
this.previousRemediator = remediator;
|
|
6892
|
-
return false;
|
|
6893
|
-
}
|
|
6894
|
-
|
|
6895
|
-
if (this.previousRemediator.getName() === remediator.getName()) {
|
|
6896
|
-
return true;
|
|
6897
|
-
}
|
|
6898
|
-
|
|
6899
|
-
this.previousRemediator = remediator;
|
|
6900
|
-
return false;
|
|
6901
|
-
}
|
|
6902
|
-
}, {
|
|
6903
|
-
key: "isRemediatorCandidate",
|
|
6904
|
-
value: function isRemediatorCandidate(remediator, remediations, values) {
|
|
6905
|
-
var remediatorName = remediator.getName();
|
|
6906
|
-
|
|
6907
|
-
if (!values.skip && remediatorName === 'skip') {
|
|
6908
|
-
return false;
|
|
6909
|
-
}
|
|
6910
|
-
|
|
6911
|
-
if (values.skip && remediatorName !== 'skip') {
|
|
6912
|
-
return false;
|
|
6913
|
-
}
|
|
6914
|
-
|
|
6915
|
-
return true;
|
|
6916
|
-
}
|
|
6917
|
-
}, {
|
|
6918
|
-
key: "trackRemediations",
|
|
6919
|
-
value: function () {
|
|
6920
|
-
var _trackRemediations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(name) {
|
|
6921
|
-
var meta, remediations;
|
|
6922
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6923
|
-
while (1) {
|
|
6924
|
-
switch (_context.prev = _context.next) {
|
|
6925
|
-
case 0:
|
|
6926
|
-
_context.next = 2;
|
|
6927
|
-
return getTransactionMeta(this.authClient);
|
|
6928
|
-
|
|
6929
|
-
case 2:
|
|
6930
|
-
meta = _context.sent;
|
|
6931
|
-
remediations = meta.remediations || [];
|
|
6932
|
-
meta = Object.assign(Object.assign({}, meta), {
|
|
6933
|
-
remediations: [].concat(_toConsumableArray(remediations), [name])
|
|
6934
|
-
});
|
|
6935
|
-
saveTransactionMeta(this.authClient, meta);
|
|
6936
|
-
|
|
6937
|
-
case 6:
|
|
6938
|
-
case "end":
|
|
6939
|
-
return _context.stop();
|
|
6940
|
-
}
|
|
6941
|
-
}
|
|
6942
|
-
}, _callee, this);
|
|
6943
|
-
}));
|
|
6944
|
-
|
|
6945
|
-
function trackRemediations(_x) {
|
|
6946
|
-
return _trackRemediations.apply(this, arguments);
|
|
6947
|
-
}
|
|
6948
|
-
|
|
6949
|
-
return trackRemediations;
|
|
6950
|
-
}()
|
|
6951
|
-
}, {
|
|
6952
|
-
key: "isFinished",
|
|
6953
|
-
value: function isFinished() {
|
|
6954
|
-
return Promise.resolve(true);
|
|
6955
|
-
}
|
|
6956
|
-
}]);
|
|
6957
|
-
|
|
6958
|
-
return FlowMonitor;
|
|
6959
|
-
}();
|
|
6960
|
-
|
|
6961
|
-
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
6962
|
-
|
|
6963
|
-
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
6964
|
-
var AuthenticationFlowMonitor = /*#__PURE__*/function (_FlowMonitor) {
|
|
6965
|
-
_inherits(AuthenticationFlowMonitor, _FlowMonitor);
|
|
6966
|
-
|
|
6967
|
-
var _super = _createSuper$2(AuthenticationFlowMonitor);
|
|
6968
|
-
|
|
6969
|
-
function AuthenticationFlowMonitor() {
|
|
6970
|
-
_classCallCheck(this, AuthenticationFlowMonitor);
|
|
6971
|
-
|
|
6972
|
-
return _super.apply(this, arguments);
|
|
6973
|
-
}
|
|
6974
|
-
|
|
6975
|
-
_createClass(AuthenticationFlowMonitor, [{
|
|
6976
|
-
key: "isRemediatorCandidate",
|
|
6977
|
-
value: function isRemediatorCandidate(remediator, remediations, values) {
|
|
6978
|
-
var _a;
|
|
6979
|
-
|
|
6980
|
-
var prevRemediatorName = (_a = this.previousRemediator) === null || _a === void 0 ? void 0 : _a.getName();
|
|
6981
|
-
var remediatorName = remediator.getName();
|
|
6982
|
-
|
|
6983
|
-
if (remediatorName === 'select-authenticator-authenticate' && ['select-authenticator-authenticate'].includes(prevRemediatorName)) {
|
|
6984
|
-
return false;
|
|
6985
|
-
}
|
|
6986
|
-
|
|
6987
|
-
if (remediatorName === 'select-authenticator-authenticate' && remediations.some(function (_ref) {
|
|
6988
|
-
var name = _ref.name;
|
|
6989
|
-
return name === 'challenge-authenticator';
|
|
6990
|
-
})) {
|
|
6991
|
-
return false;
|
|
6992
|
-
}
|
|
7158
|
+
}), nextStep && {
|
|
7159
|
+
nextStep: nextStep
|
|
7160
|
+
}), messages && {
|
|
7161
|
+
messages: messages
|
|
7162
|
+
}), error && {
|
|
7163
|
+
error: error
|
|
7164
|
+
}));
|
|
6993
7165
|
|
|
6994
|
-
|
|
6995
|
-
|
|
7166
|
+
case 58:
|
|
7167
|
+
case "end":
|
|
7168
|
+
return _context.stop();
|
|
7169
|
+
}
|
|
6996
7170
|
}
|
|
7171
|
+
}, _callee, null, [[3, 51]]);
|
|
7172
|
+
}));
|
|
7173
|
+
return _run.apply(this, arguments);
|
|
7174
|
+
}
|
|
6997
7175
|
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7176
|
+
var AuthenticationFlow = {
|
|
7177
|
+
'identify': Identify,
|
|
7178
|
+
'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,
|
|
7179
|
+
'select-authenticator-enroll': SelectAuthenticatorEnroll,
|
|
7180
|
+
'authenticator-enrollment-data': AuthenticatorEnrollmentData,
|
|
7181
|
+
'authenticator-verification-data': AuthenticatorVerificationData,
|
|
7182
|
+
'enroll-authenticator': EnrollAuthenticator,
|
|
7183
|
+
'challenge-authenticator': ChallengeAuthenticator,
|
|
7184
|
+
'challenge-poll': ChallengePoll,
|
|
7185
|
+
'reenroll-authenticator': ReEnrollAuthenticator,
|
|
7186
|
+
'enroll-poll': EnrollPoll,
|
|
7187
|
+
'redirect-idp': RedirectIdp,
|
|
7188
|
+
'skip': Skip
|
|
7189
|
+
};
|
|
7004
7190
|
|
|
7005
7191
|
var PasswordRecoveryFlow = {
|
|
7006
7192
|
'identify': Identify,
|
|
@@ -7012,162 +7198,41 @@ var PasswordRecoveryFlow = {
|
|
|
7012
7198
|
'reenroll-authenticator': ReEnrollAuthenticator
|
|
7013
7199
|
};
|
|
7014
7200
|
|
|
7015
|
-
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7016
|
-
|
|
7017
|
-
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
7018
|
-
var PasswordRecoveryFlowMonitor = /*#__PURE__*/function (_FlowMonitor) {
|
|
7019
|
-
_inherits(PasswordRecoveryFlowMonitor, _FlowMonitor);
|
|
7020
|
-
|
|
7021
|
-
var _super = _createSuper$1(PasswordRecoveryFlowMonitor);
|
|
7022
|
-
|
|
7023
|
-
function PasswordRecoveryFlowMonitor() {
|
|
7024
|
-
_classCallCheck(this, PasswordRecoveryFlowMonitor);
|
|
7025
|
-
|
|
7026
|
-
return _super.apply(this, arguments);
|
|
7027
|
-
}
|
|
7028
|
-
|
|
7029
|
-
_createClass(PasswordRecoveryFlowMonitor, [{
|
|
7030
|
-
key: "isRemediatorCandidate",
|
|
7031
|
-
value: function isRemediatorCandidate(remediator, remediations, values) {
|
|
7032
|
-
var _a;
|
|
7033
|
-
|
|
7034
|
-
var prevRemediatorName = (_a = this.previousRemediator) === null || _a === void 0 ? void 0 : _a.getName();
|
|
7035
|
-
var remediatorName = remediator.getName();
|
|
7036
|
-
|
|
7037
|
-
if (remediatorName === 'select-authenticator-authenticate' && ['select-authenticator-authenticate', 'reenroll-authenticator'].includes(prevRemediatorName)) {
|
|
7038
|
-
return false;
|
|
7039
|
-
}
|
|
7040
|
-
|
|
7041
|
-
if (remediatorName === 'select-authenticator-authenticate' && remediations.some(function (_ref) {
|
|
7042
|
-
var name = _ref.name;
|
|
7043
|
-
return name === 'challenge-authenticator';
|
|
7044
|
-
})) {
|
|
7045
|
-
return false;
|
|
7046
|
-
}
|
|
7047
|
-
|
|
7048
|
-
return _get(_getPrototypeOf(PasswordRecoveryFlowMonitor.prototype), "isRemediatorCandidate", this).call(this, remediator, remediations, values);
|
|
7049
|
-
}
|
|
7050
|
-
}, {
|
|
7051
|
-
key: "isFinished",
|
|
7052
|
-
value: function () {
|
|
7053
|
-
var _isFinished = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
7054
|
-
var _yield$getTransaction, remediations;
|
|
7055
|
-
|
|
7056
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7057
|
-
while (1) {
|
|
7058
|
-
switch (_context.prev = _context.next) {
|
|
7059
|
-
case 0:
|
|
7060
|
-
_context.next = 2;
|
|
7061
|
-
return getTransactionMeta(this.authClient);
|
|
7062
|
-
|
|
7063
|
-
case 2:
|
|
7064
|
-
_yield$getTransaction = _context.sent;
|
|
7065
|
-
remediations = _yield$getTransaction.remediations;
|
|
7066
|
-
|
|
7067
|
-
if (remediations.includes('reset-authenticator')) {
|
|
7068
|
-
_context.next = 6;
|
|
7069
|
-
break;
|
|
7070
|
-
}
|
|
7071
|
-
|
|
7072
|
-
return _context.abrupt("return", false);
|
|
7073
|
-
|
|
7074
|
-
case 6:
|
|
7075
|
-
_context.next = 8;
|
|
7076
|
-
return _get(_getPrototypeOf(PasswordRecoveryFlowMonitor.prototype), "isFinished", this).call(this);
|
|
7077
|
-
|
|
7078
|
-
case 8:
|
|
7079
|
-
return _context.abrupt("return", _context.sent);
|
|
7080
|
-
|
|
7081
|
-
case 9:
|
|
7082
|
-
case "end":
|
|
7083
|
-
return _context.stop();
|
|
7084
|
-
}
|
|
7085
|
-
}
|
|
7086
|
-
}, _callee, this);
|
|
7087
|
-
}));
|
|
7088
|
-
|
|
7089
|
-
function isFinished() {
|
|
7090
|
-
return _isFinished.apply(this, arguments);
|
|
7091
|
-
}
|
|
7092
|
-
|
|
7093
|
-
return isFinished;
|
|
7094
|
-
}()
|
|
7095
|
-
}]);
|
|
7096
|
-
|
|
7097
|
-
return PasswordRecoveryFlowMonitor;
|
|
7098
|
-
}(FlowMonitor);
|
|
7099
|
-
|
|
7100
7201
|
var RegistrationFlow = {
|
|
7101
7202
|
'select-enroll-profile': SelectEnrollProfile,
|
|
7102
7203
|
'enroll-profile': EnrollProfile,
|
|
7103
7204
|
'authenticator-enrollment-data': AuthenticatorEnrollmentData,
|
|
7104
7205
|
'select-authenticator-enroll': SelectAuthenticatorEnroll,
|
|
7206
|
+
'enroll-poll': EnrollPoll,
|
|
7105
7207
|
'enroll-authenticator': EnrollAuthenticator,
|
|
7106
7208
|
'skip': Skip
|
|
7107
7209
|
};
|
|
7108
7210
|
|
|
7109
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7110
|
-
|
|
7111
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
7112
|
-
var RegistrationFlowMonitor = /*#__PURE__*/function (_FlowMonitor) {
|
|
7113
|
-
_inherits(RegistrationFlowMonitor, _FlowMonitor);
|
|
7114
|
-
|
|
7115
|
-
var _super = _createSuper(RegistrationFlowMonitor);
|
|
7116
|
-
|
|
7117
|
-
function RegistrationFlowMonitor() {
|
|
7118
|
-
_classCallCheck(this, RegistrationFlowMonitor);
|
|
7119
|
-
|
|
7120
|
-
return _super.apply(this, arguments);
|
|
7121
|
-
}
|
|
7122
|
-
|
|
7123
|
-
_createClass(RegistrationFlowMonitor, [{
|
|
7124
|
-
key: "isRemediatorCandidate",
|
|
7125
|
-
value: function isRemediatorCandidate(remediator, remediations, values) {
|
|
7126
|
-
var _a;
|
|
7127
|
-
|
|
7128
|
-
var prevRemediatorName = (_a = this.previousRemediator) === null || _a === void 0 ? void 0 : _a.getName();
|
|
7129
|
-
var remediatorName = remediator.getName();
|
|
7130
|
-
|
|
7131
|
-
if (remediatorName === 'select-authenticator-enroll' && ['select-authenticator-enroll', 'authenticator-enrollment-data'].includes(prevRemediatorName)) {
|
|
7132
|
-
return false;
|
|
7133
|
-
}
|
|
7134
|
-
|
|
7135
|
-
return _get(_getPrototypeOf(RegistrationFlowMonitor.prototype), "isRemediatorCandidate", this).call(this, remediator, remediations, values);
|
|
7136
|
-
}
|
|
7137
|
-
}]);
|
|
7138
|
-
|
|
7139
|
-
return RegistrationFlowMonitor;
|
|
7140
|
-
}(FlowMonitor);
|
|
7141
|
-
|
|
7142
7211
|
function getFlowSpecification(oktaAuth) {
|
|
7143
7212
|
var flow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'proceed';
|
|
7144
|
-
var remediators,
|
|
7213
|
+
var remediators, actions;
|
|
7145
7214
|
|
|
7146
7215
|
switch (flow) {
|
|
7147
7216
|
case 'register':
|
|
7148
7217
|
case 'signup':
|
|
7149
7218
|
case 'enrollProfile':
|
|
7150
7219
|
remediators = RegistrationFlow;
|
|
7151
|
-
flowMonitor = new RegistrationFlowMonitor(oktaAuth);
|
|
7152
7220
|
break;
|
|
7153
7221
|
|
|
7154
7222
|
case 'recoverPassword':
|
|
7155
7223
|
case 'resetPassword':
|
|
7156
7224
|
remediators = PasswordRecoveryFlow;
|
|
7157
|
-
flowMonitor = new PasswordRecoveryFlowMonitor(oktaAuth);
|
|
7158
7225
|
actions = ['currentAuthenticator-recover', 'currentAuthenticatorEnrollment-recover'];
|
|
7159
7226
|
break;
|
|
7160
7227
|
|
|
7161
7228
|
default:
|
|
7162
7229
|
remediators = AuthenticationFlow;
|
|
7163
|
-
flowMonitor = new AuthenticationFlowMonitor(oktaAuth);
|
|
7164
7230
|
break;
|
|
7165
7231
|
}
|
|
7166
7232
|
|
|
7167
7233
|
return {
|
|
7168
7234
|
flow: flow,
|
|
7169
7235
|
remediators: remediators,
|
|
7170
|
-
flowMonitor: flowMonitor,
|
|
7171
7236
|
actions: actions
|
|
7172
7237
|
};
|
|
7173
7238
|
}
|
|
@@ -7202,15 +7267,18 @@ function cancel(_x, _x2) {
|
|
|
7202
7267
|
|
|
7203
7268
|
function _cancel() {
|
|
7204
7269
|
_cancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(authClient, options) {
|
|
7270
|
+
var meta, flowSpec;
|
|
7205
7271
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7206
7272
|
while (1) {
|
|
7207
7273
|
switch (_context.prev = _context.next) {
|
|
7208
7274
|
case 0:
|
|
7209
|
-
|
|
7275
|
+
meta = authClient.transactionManager.load();
|
|
7276
|
+
flowSpec = getFlowSpecification(authClient, meta.flow);
|
|
7277
|
+
return _context.abrupt("return", run(authClient, Object.assign(Object.assign(Object.assign({}, options), flowSpec), {
|
|
7210
7278
|
actions: ['cancel']
|
|
7211
7279
|
})));
|
|
7212
7280
|
|
|
7213
|
-
case
|
|
7281
|
+
case 3:
|
|
7214
7282
|
case "end":
|
|
7215
7283
|
return _context.stop();
|
|
7216
7284
|
}
|
|
@@ -7267,6 +7335,89 @@ function _proceed() {
|
|
|
7267
7335
|
return _proceed.apply(this, arguments);
|
|
7268
7336
|
}
|
|
7269
7337
|
|
|
7338
|
+
function poll(_x) {
|
|
7339
|
+
return _poll.apply(this, arguments);
|
|
7340
|
+
}
|
|
7341
|
+
|
|
7342
|
+
function _poll() {
|
|
7343
|
+
_poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(authClient) {
|
|
7344
|
+
var options,
|
|
7345
|
+
_a,
|
|
7346
|
+
transaction,
|
|
7347
|
+
meta,
|
|
7348
|
+
availablePollingRemeditaions,
|
|
7349
|
+
_args2 = arguments;
|
|
7350
|
+
|
|
7351
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
7352
|
+
while (1) {
|
|
7353
|
+
switch (_context2.prev = _context2.next) {
|
|
7354
|
+
case 0:
|
|
7355
|
+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
7356
|
+
_context2.next = 3;
|
|
7357
|
+
return proceed(authClient, {
|
|
7358
|
+
startPolling: true
|
|
7359
|
+
});
|
|
7360
|
+
|
|
7361
|
+
case 3:
|
|
7362
|
+
transaction = _context2.sent;
|
|
7363
|
+
meta = getSavedTransactionMeta(authClient);
|
|
7364
|
+
availablePollingRemeditaions = (_a = meta === null || meta === void 0 ? void 0 : meta.remediations) === null || _a === void 0 ? void 0 : _a.find(function (remediation) {
|
|
7365
|
+
return remediation.includes('poll');
|
|
7366
|
+
});
|
|
7367
|
+
|
|
7368
|
+
if (!(availablePollingRemeditaions === null || availablePollingRemeditaions === void 0 ? void 0 : availablePollingRemeditaions.length)) {
|
|
7369
|
+
warn('No polling remediations available at the current IDX flow stage');
|
|
7370
|
+
}
|
|
7371
|
+
|
|
7372
|
+
if (!Number.isInteger(options.refresh)) {
|
|
7373
|
+
_context2.next = 9;
|
|
7374
|
+
break;
|
|
7375
|
+
}
|
|
7376
|
+
|
|
7377
|
+
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
7378
|
+
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
7379
|
+
var _a, _b, refresh;
|
|
7380
|
+
|
|
7381
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7382
|
+
while (1) {
|
|
7383
|
+
switch (_context.prev = _context.next) {
|
|
7384
|
+
case 0:
|
|
7385
|
+
try {
|
|
7386
|
+
refresh = (_b = (_a = transaction.nextStep) === null || _a === void 0 ? void 0 : _a.poll) === null || _b === void 0 ? void 0 : _b.refresh;
|
|
7387
|
+
|
|
7388
|
+
if (refresh) {
|
|
7389
|
+
resolve(poll(authClient, {
|
|
7390
|
+
refresh: refresh
|
|
7391
|
+
}));
|
|
7392
|
+
} else {
|
|
7393
|
+
resolve(transaction);
|
|
7394
|
+
}
|
|
7395
|
+
} catch (err) {
|
|
7396
|
+
reject(err);
|
|
7397
|
+
}
|
|
7398
|
+
|
|
7399
|
+
case 1:
|
|
7400
|
+
case "end":
|
|
7401
|
+
return _context.stop();
|
|
7402
|
+
}
|
|
7403
|
+
}
|
|
7404
|
+
}, _callee);
|
|
7405
|
+
})), options.refresh);
|
|
7406
|
+
}));
|
|
7407
|
+
|
|
7408
|
+
case 9:
|
|
7409
|
+
return _context2.abrupt("return", transaction);
|
|
7410
|
+
|
|
7411
|
+
case 10:
|
|
7412
|
+
case "end":
|
|
7413
|
+
return _context2.stop();
|
|
7414
|
+
}
|
|
7415
|
+
}
|
|
7416
|
+
}, _callee2);
|
|
7417
|
+
}));
|
|
7418
|
+
return _poll.apply(this, arguments);
|
|
7419
|
+
}
|
|
7420
|
+
|
|
7270
7421
|
function startTransaction(_x) {
|
|
7271
7422
|
return _startTransaction.apply(this, arguments);
|
|
7272
7423
|
}
|
|
@@ -7293,34 +7444,44 @@ function _startTransaction() {
|
|
|
7293
7444
|
return _startTransaction.apply(this, arguments);
|
|
7294
7445
|
}
|
|
7295
7446
|
|
|
7296
|
-
function register(_x
|
|
7447
|
+
function register(_x) {
|
|
7297
7448
|
return _register.apply(this, arguments);
|
|
7298
7449
|
}
|
|
7299
7450
|
|
|
7300
7451
|
function _register() {
|
|
7301
|
-
_register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(authClient
|
|
7302
|
-
var
|
|
7452
|
+
_register = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(authClient) {
|
|
7453
|
+
var options,
|
|
7454
|
+
_yield$startTransacti,
|
|
7455
|
+
enabledFeatures,
|
|
7456
|
+
availableSteps,
|
|
7457
|
+
error,
|
|
7458
|
+
_error,
|
|
7459
|
+
flowSpec,
|
|
7460
|
+
_args = arguments;
|
|
7303
7461
|
|
|
7304
7462
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7305
7463
|
while (1) {
|
|
7306
7464
|
switch (_context.prev = _context.next) {
|
|
7307
7465
|
case 0:
|
|
7466
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
7467
|
+
|
|
7308
7468
|
if (transactionMetaExist(authClient)) {
|
|
7309
|
-
_context.next =
|
|
7469
|
+
_context.next = 13;
|
|
7310
7470
|
break;
|
|
7311
7471
|
}
|
|
7312
7472
|
|
|
7313
|
-
_context.next =
|
|
7473
|
+
_context.next = 4;
|
|
7314
7474
|
return startTransaction(authClient, Object.assign({
|
|
7315
7475
|
flow: 'register'
|
|
7316
7476
|
}, options));
|
|
7317
7477
|
|
|
7318
|
-
case
|
|
7478
|
+
case 4:
|
|
7319
7479
|
_yield$startTransacti = _context.sent;
|
|
7320
7480
|
enabledFeatures = _yield$startTransacti.enabledFeatures;
|
|
7481
|
+
availableSteps = _yield$startTransacti.availableSteps;
|
|
7321
7482
|
|
|
7322
|
-
if (!(enabledFeatures && !enabledFeatures.includes(IdxFeature.REGISTRATION))) {
|
|
7323
|
-
_context.next =
|
|
7483
|
+
if (!(!options.activationToken && enabledFeatures && !enabledFeatures.includes(IdxFeature.REGISTRATION))) {
|
|
7484
|
+
_context.next = 10;
|
|
7324
7485
|
break;
|
|
7325
7486
|
}
|
|
7326
7487
|
|
|
@@ -7330,11 +7491,26 @@ function _register() {
|
|
|
7330
7491
|
error: error
|
|
7331
7492
|
});
|
|
7332
7493
|
|
|
7333
|
-
case
|
|
7494
|
+
case 10:
|
|
7495
|
+
if (!(options.activationToken && (availableSteps === null || availableSteps === void 0 ? void 0 : availableSteps.some(function (_ref) {
|
|
7496
|
+
var name = _ref.name;
|
|
7497
|
+
return name === 'identify';
|
|
7498
|
+
})))) {
|
|
7499
|
+
_context.next = 13;
|
|
7500
|
+
break;
|
|
7501
|
+
}
|
|
7502
|
+
|
|
7503
|
+
_error = new AuthSdkError('activationToken is not supported based on your current org configuration.');
|
|
7504
|
+
return _context.abrupt("return", {
|
|
7505
|
+
status: IdxStatus.FAILURE,
|
|
7506
|
+
error: _error
|
|
7507
|
+
});
|
|
7508
|
+
|
|
7509
|
+
case 13:
|
|
7334
7510
|
flowSpec = getFlowSpecification(authClient, 'register');
|
|
7335
7511
|
return _context.abrupt("return", run(authClient, Object.assign(Object.assign({}, options), flowSpec)));
|
|
7336
7512
|
|
|
7337
|
-
case
|
|
7513
|
+
case 15:
|
|
7338
7514
|
case "end":
|
|
7339
7515
|
return _context.stop();
|
|
7340
7516
|
}
|
|
@@ -7459,7 +7635,7 @@ var OktaUserAgent = /*#__PURE__*/function () {
|
|
|
7459
7635
|
function OktaUserAgent() {
|
|
7460
7636
|
_classCallCheck(this, OktaUserAgent);
|
|
7461
7637
|
|
|
7462
|
-
this.environments = ["okta-auth-js/".concat("5.
|
|
7638
|
+
this.environments = ["okta-auth-js/".concat("5.11.0")];
|
|
7463
7639
|
}
|
|
7464
7640
|
|
|
7465
7641
|
_createClass(OktaUserAgent, [{
|
|
@@ -7478,7 +7654,7 @@ var OktaUserAgent = /*#__PURE__*/function () {
|
|
|
7478
7654
|
}, {
|
|
7479
7655
|
key: "getVersion",
|
|
7480
7656
|
value: function getVersion() {
|
|
7481
|
-
return "5.
|
|
7657
|
+
return "5.11.0";
|
|
7482
7658
|
}
|
|
7483
7659
|
}, {
|
|
7484
7660
|
key: "maybeAddNodeEnvironment",
|
|
@@ -7537,9 +7713,9 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
7537
7713
|
this.options = Object.assign(this.options, {
|
|
7538
7714
|
redirectUri: toAbsoluteUrl(args.redirectUri, window.location.origin)
|
|
7539
7715
|
});
|
|
7540
|
-
this.userAgent = getUserAgent(args, "okta-auth-js/".concat("5.
|
|
7716
|
+
this.userAgent = getUserAgent(args, "okta-auth-js/".concat("5.11.0"));
|
|
7541
7717
|
} else {
|
|
7542
|
-
this.userAgent = getUserAgent(args, "okta-auth-js-server/".concat("5.
|
|
7718
|
+
this.userAgent = getUserAgent(args, "okta-auth-js-server/".concat("5.11.0"));
|
|
7543
7719
|
}
|
|
7544
7720
|
|
|
7545
7721
|
if (!args.maxClockSkew && args.maxClockSkew !== 0) {
|
|
@@ -7603,6 +7779,7 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
7603
7779
|
introspect: introspect.bind(null, this),
|
|
7604
7780
|
authenticate: authenticate.bind(null, this),
|
|
7605
7781
|
register: register.bind(null, this),
|
|
7782
|
+
poll: poll.bind(null, this),
|
|
7606
7783
|
proceed: proceed.bind(null, this),
|
|
7607
7784
|
cancel: cancel.bind(null, this),
|
|
7608
7785
|
recoverPassword: recoverPassword.bind(null, this),
|
|
@@ -7797,8 +7974,22 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
7797
7974
|
}, {
|
|
7798
7975
|
key: "closeSession",
|
|
7799
7976
|
value: function closeSession() {
|
|
7800
|
-
this
|
|
7801
|
-
|
|
7977
|
+
var _this3 = this;
|
|
7978
|
+
|
|
7979
|
+
return this.session.close().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
7980
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
7981
|
+
while (1) {
|
|
7982
|
+
switch (_context4.prev = _context4.next) {
|
|
7983
|
+
case 0:
|
|
7984
|
+
_this3.tokenManager.clear();
|
|
7985
|
+
|
|
7986
|
+
case 1:
|
|
7987
|
+
case "end":
|
|
7988
|
+
return _context4.stop();
|
|
7989
|
+
}
|
|
7990
|
+
}
|
|
7991
|
+
}, _callee4);
|
|
7992
|
+
}))).catch(function (e) {
|
|
7802
7993
|
if (e.name === 'AuthApiError' && e.errorCode === 'E0000007') {
|
|
7803
7994
|
return null;
|
|
7804
7995
|
}
|
|
@@ -7809,42 +8000,42 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
7809
8000
|
}, {
|
|
7810
8001
|
key: "revokeAccessToken",
|
|
7811
8002
|
value: function () {
|
|
7812
|
-
var _revokeAccessToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8003
|
+
var _revokeAccessToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(accessToken) {
|
|
7813
8004
|
var accessTokenKey;
|
|
7814
|
-
return _regeneratorRuntime.wrap(function
|
|
8005
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
7815
8006
|
while (1) {
|
|
7816
|
-
switch (
|
|
8007
|
+
switch (_context5.prev = _context5.next) {
|
|
7817
8008
|
case 0:
|
|
7818
8009
|
if (accessToken) {
|
|
7819
|
-
|
|
8010
|
+
_context5.next = 6;
|
|
7820
8011
|
break;
|
|
7821
8012
|
}
|
|
7822
8013
|
|
|
7823
|
-
|
|
8014
|
+
_context5.next = 3;
|
|
7824
8015
|
return this.tokenManager.getTokens();
|
|
7825
8016
|
|
|
7826
8017
|
case 3:
|
|
7827
|
-
accessToken =
|
|
8018
|
+
accessToken = _context5.sent.accessToken;
|
|
7828
8019
|
accessTokenKey = this.tokenManager.getStorageKeyByType('accessToken');
|
|
7829
8020
|
this.tokenManager.remove(accessTokenKey);
|
|
7830
8021
|
|
|
7831
8022
|
case 6:
|
|
7832
8023
|
if (accessToken) {
|
|
7833
|
-
|
|
8024
|
+
_context5.next = 8;
|
|
7834
8025
|
break;
|
|
7835
8026
|
}
|
|
7836
8027
|
|
|
7837
|
-
return
|
|
8028
|
+
return _context5.abrupt("return", Promise.resolve(null));
|
|
7838
8029
|
|
|
7839
8030
|
case 8:
|
|
7840
|
-
return
|
|
8031
|
+
return _context5.abrupt("return", this.token.revoke(accessToken));
|
|
7841
8032
|
|
|
7842
8033
|
case 9:
|
|
7843
8034
|
case "end":
|
|
7844
|
-
return
|
|
8035
|
+
return _context5.stop();
|
|
7845
8036
|
}
|
|
7846
8037
|
}
|
|
7847
|
-
},
|
|
8038
|
+
}, _callee5, this);
|
|
7848
8039
|
}));
|
|
7849
8040
|
|
|
7850
8041
|
function revokeAccessToken(_x3) {
|
|
@@ -7856,42 +8047,42 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
7856
8047
|
}, {
|
|
7857
8048
|
key: "revokeRefreshToken",
|
|
7858
8049
|
value: function () {
|
|
7859
|
-
var _revokeRefreshToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8050
|
+
var _revokeRefreshToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(refreshToken) {
|
|
7860
8051
|
var refreshTokenKey;
|
|
7861
|
-
return _regeneratorRuntime.wrap(function
|
|
8052
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
7862
8053
|
while (1) {
|
|
7863
|
-
switch (
|
|
8054
|
+
switch (_context6.prev = _context6.next) {
|
|
7864
8055
|
case 0:
|
|
7865
8056
|
if (refreshToken) {
|
|
7866
|
-
|
|
8057
|
+
_context6.next = 6;
|
|
7867
8058
|
break;
|
|
7868
8059
|
}
|
|
7869
8060
|
|
|
7870
|
-
|
|
8061
|
+
_context6.next = 3;
|
|
7871
8062
|
return this.tokenManager.getTokens();
|
|
7872
8063
|
|
|
7873
8064
|
case 3:
|
|
7874
|
-
refreshToken =
|
|
8065
|
+
refreshToken = _context6.sent.refreshToken;
|
|
7875
8066
|
refreshTokenKey = this.tokenManager.getStorageKeyByType('refreshToken');
|
|
7876
8067
|
this.tokenManager.remove(refreshTokenKey);
|
|
7877
8068
|
|
|
7878
8069
|
case 6:
|
|
7879
8070
|
if (refreshToken) {
|
|
7880
|
-
|
|
8071
|
+
_context6.next = 8;
|
|
7881
8072
|
break;
|
|
7882
8073
|
}
|
|
7883
8074
|
|
|
7884
|
-
return
|
|
8075
|
+
return _context6.abrupt("return", Promise.resolve(null));
|
|
7885
8076
|
|
|
7886
8077
|
case 8:
|
|
7887
|
-
return
|
|
8078
|
+
return _context6.abrupt("return", this.token.revoke(refreshToken));
|
|
7888
8079
|
|
|
7889
8080
|
case 9:
|
|
7890
8081
|
case "end":
|
|
7891
|
-
return
|
|
8082
|
+
return _context6.stop();
|
|
7892
8083
|
}
|
|
7893
8084
|
}
|
|
7894
|
-
},
|
|
8085
|
+
}, _callee6, this);
|
|
7895
8086
|
}));
|
|
7896
8087
|
|
|
7897
8088
|
function revokeRefreshToken(_x4) {
|
|
@@ -7937,11 +8128,11 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
7937
8128
|
}, {
|
|
7938
8129
|
key: "signOut",
|
|
7939
8130
|
value: function () {
|
|
7940
|
-
var _signOut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8131
|
+
var _signOut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(options) {
|
|
7941
8132
|
var defaultUri, currentUri, postLogoutRedirectUri, accessToken, refreshToken, revokeAccessToken, revokeRefreshToken, logoutUri;
|
|
7942
|
-
return _regeneratorRuntime.wrap(function
|
|
8133
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
7943
8134
|
while (1) {
|
|
7944
|
-
switch (
|
|
8135
|
+
switch (_context7.prev = _context7.next) {
|
|
7945
8136
|
case 0:
|
|
7946
8137
|
options = Object.assign({}, options);
|
|
7947
8138
|
defaultUri = window.location.origin;
|
|
@@ -7964,36 +8155,34 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
7964
8155
|
options.idToken = this.tokenManager.getTokensSync().idToken;
|
|
7965
8156
|
}
|
|
7966
8157
|
|
|
7967
|
-
this.tokenManager.clear();
|
|
7968
|
-
|
|
7969
8158
|
if (!(revokeRefreshToken && refreshToken)) {
|
|
7970
|
-
|
|
8159
|
+
_context7.next = 14;
|
|
7971
8160
|
break;
|
|
7972
8161
|
}
|
|
7973
8162
|
|
|
7974
|
-
|
|
8163
|
+
_context7.next = 14;
|
|
7975
8164
|
return this.revokeRefreshToken(refreshToken);
|
|
7976
8165
|
|
|
7977
|
-
case
|
|
8166
|
+
case 14:
|
|
7978
8167
|
if (!(revokeAccessToken && accessToken)) {
|
|
7979
|
-
|
|
8168
|
+
_context7.next = 17;
|
|
7980
8169
|
break;
|
|
7981
8170
|
}
|
|
7982
8171
|
|
|
7983
|
-
|
|
8172
|
+
_context7.next = 17;
|
|
7984
8173
|
return this.revokeAccessToken(accessToken);
|
|
7985
8174
|
|
|
7986
|
-
case
|
|
8175
|
+
case 17:
|
|
7987
8176
|
logoutUri = this.getSignOutRedirectUrl(Object.assign(Object.assign({}, options), {
|
|
7988
8177
|
postLogoutRedirectUri: postLogoutRedirectUri
|
|
7989
8178
|
}));
|
|
7990
8179
|
|
|
7991
8180
|
if (logoutUri) {
|
|
7992
|
-
|
|
8181
|
+
_context7.next = 22;
|
|
7993
8182
|
break;
|
|
7994
8183
|
}
|
|
7995
8184
|
|
|
7996
|
-
return
|
|
8185
|
+
return _context7.abrupt("return", this.closeSession().then(function () {
|
|
7997
8186
|
if (postLogoutRedirectUri === currentUri) {
|
|
7998
8187
|
window.location.reload();
|
|
7999
8188
|
} else {
|
|
@@ -8001,15 +8190,21 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
8001
8190
|
}
|
|
8002
8191
|
}));
|
|
8003
8192
|
|
|
8004
|
-
case
|
|
8193
|
+
case 22:
|
|
8194
|
+
if (options.clearTokensAfterRedirect) {
|
|
8195
|
+
this.tokenManager.addPendingRemoveFlags();
|
|
8196
|
+
} else {
|
|
8197
|
+
this.tokenManager.clear();
|
|
8198
|
+
}
|
|
8199
|
+
|
|
8005
8200
|
window.location.assign(logoutUri);
|
|
8006
8201
|
|
|
8007
8202
|
case 24:
|
|
8008
8203
|
case "end":
|
|
8009
|
-
return
|
|
8204
|
+
return _context7.stop();
|
|
8010
8205
|
}
|
|
8011
8206
|
}
|
|
8012
|
-
},
|
|
8207
|
+
}, _callee7, this);
|
|
8013
8208
|
}));
|
|
8014
8209
|
|
|
8015
8210
|
function signOut(_x5) {
|
|
@@ -8032,76 +8227,94 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
8032
8227
|
}, {
|
|
8033
8228
|
key: "isAuthenticated",
|
|
8034
8229
|
value: function () {
|
|
8035
|
-
var _isAuthenticated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8230
|
+
var _isAuthenticated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
8036
8231
|
var _this$tokenManager$ge, accessToken, idToken, _this$tokenManager$ge2, autoRenew, autoRemove;
|
|
8037
8232
|
|
|
8038
|
-
return _regeneratorRuntime.wrap(function
|
|
8233
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
8039
8234
|
while (1) {
|
|
8040
|
-
switch (
|
|
8235
|
+
switch (_context8.prev = _context8.next) {
|
|
8041
8236
|
case 0:
|
|
8042
8237
|
_this$tokenManager$ge = this.tokenManager.getTokensSync(), accessToken = _this$tokenManager$ge.accessToken, idToken = _this$tokenManager$ge.idToken;
|
|
8043
8238
|
_this$tokenManager$ge2 = this.tokenManager.getOptions(), autoRenew = _this$tokenManager$ge2.autoRenew, autoRemove = _this$tokenManager$ge2.autoRemove;
|
|
8044
8239
|
|
|
8045
8240
|
if (!(accessToken && this.tokenManager.hasExpired(accessToken))) {
|
|
8046
|
-
|
|
8241
|
+
_context8.next = 16;
|
|
8047
8242
|
break;
|
|
8048
8243
|
}
|
|
8049
8244
|
|
|
8050
8245
|
accessToken = null;
|
|
8051
8246
|
|
|
8052
8247
|
if (!autoRenew) {
|
|
8053
|
-
|
|
8248
|
+
_context8.next = 15;
|
|
8054
8249
|
break;
|
|
8055
8250
|
}
|
|
8056
8251
|
|
|
8057
|
-
|
|
8252
|
+
_context8.prev = 5;
|
|
8253
|
+
_context8.next = 8;
|
|
8058
8254
|
return this.tokenManager.renew('accessToken');
|
|
8059
8255
|
|
|
8060
|
-
case
|
|
8061
|
-
accessToken =
|
|
8062
|
-
|
|
8256
|
+
case 8:
|
|
8257
|
+
accessToken = _context8.sent;
|
|
8258
|
+
_context8.next = 13;
|
|
8063
8259
|
break;
|
|
8064
8260
|
|
|
8065
|
-
case
|
|
8261
|
+
case 11:
|
|
8262
|
+
_context8.prev = 11;
|
|
8263
|
+
_context8.t0 = _context8["catch"](5);
|
|
8264
|
+
|
|
8265
|
+
case 13:
|
|
8266
|
+
_context8.next = 16;
|
|
8267
|
+
break;
|
|
8268
|
+
|
|
8269
|
+
case 15:
|
|
8066
8270
|
if (autoRemove) {
|
|
8067
8271
|
this.tokenManager.remove('accessToken');
|
|
8068
8272
|
}
|
|
8069
8273
|
|
|
8070
|
-
case
|
|
8274
|
+
case 16:
|
|
8071
8275
|
if (!(idToken && this.tokenManager.hasExpired(idToken))) {
|
|
8072
|
-
|
|
8276
|
+
_context8.next = 30;
|
|
8073
8277
|
break;
|
|
8074
8278
|
}
|
|
8075
8279
|
|
|
8076
8280
|
idToken = null;
|
|
8077
8281
|
|
|
8078
8282
|
if (!autoRenew) {
|
|
8079
|
-
|
|
8283
|
+
_context8.next = 29;
|
|
8080
8284
|
break;
|
|
8081
8285
|
}
|
|
8082
8286
|
|
|
8083
|
-
|
|
8287
|
+
_context8.prev = 19;
|
|
8288
|
+
_context8.next = 22;
|
|
8084
8289
|
return this.tokenManager.renew('idToken');
|
|
8085
8290
|
|
|
8086
|
-
case
|
|
8087
|
-
idToken =
|
|
8088
|
-
|
|
8291
|
+
case 22:
|
|
8292
|
+
idToken = _context8.sent;
|
|
8293
|
+
_context8.next = 27;
|
|
8089
8294
|
break;
|
|
8090
8295
|
|
|
8091
|
-
case
|
|
8296
|
+
case 25:
|
|
8297
|
+
_context8.prev = 25;
|
|
8298
|
+
_context8.t1 = _context8["catch"](19);
|
|
8299
|
+
|
|
8300
|
+
case 27:
|
|
8301
|
+
_context8.next = 30;
|
|
8302
|
+
break;
|
|
8303
|
+
|
|
8304
|
+
case 29:
|
|
8092
8305
|
if (autoRemove) {
|
|
8093
8306
|
this.tokenManager.remove('idToken');
|
|
8094
8307
|
}
|
|
8095
8308
|
|
|
8096
|
-
case
|
|
8097
|
-
return
|
|
8309
|
+
case 30:
|
|
8310
|
+
return _context8.abrupt("return", !!(accessToken && idToken));
|
|
8098
8311
|
|
|
8099
|
-
case
|
|
8312
|
+
case 31:
|
|
8100
8313
|
case "end":
|
|
8101
|
-
return
|
|
8314
|
+
return _context8.stop();
|
|
8102
8315
|
}
|
|
8103
8316
|
}
|
|
8104
|
-
},
|
|
8317
|
+
}, _callee8, this, [[5, 11], [19, 25]]);
|
|
8105
8318
|
}));
|
|
8106
8319
|
|
|
8107
8320
|
function isAuthenticated() {
|
|
@@ -8113,22 +8326,22 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
8113
8326
|
}, {
|
|
8114
8327
|
key: "getUser",
|
|
8115
8328
|
value: function () {
|
|
8116
|
-
var _getUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8329
|
+
var _getUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
8117
8330
|
var _this$tokenManager$ge3, idToken, accessToken;
|
|
8118
8331
|
|
|
8119
|
-
return _regeneratorRuntime.wrap(function
|
|
8332
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
8120
8333
|
while (1) {
|
|
8121
|
-
switch (
|
|
8334
|
+
switch (_context9.prev = _context9.next) {
|
|
8122
8335
|
case 0:
|
|
8123
8336
|
_this$tokenManager$ge3 = this.tokenManager.getTokensSync(), idToken = _this$tokenManager$ge3.idToken, accessToken = _this$tokenManager$ge3.accessToken;
|
|
8124
|
-
return
|
|
8337
|
+
return _context9.abrupt("return", this.token.getUserInfo(accessToken, idToken));
|
|
8125
8338
|
|
|
8126
8339
|
case 2:
|
|
8127
8340
|
case "end":
|
|
8128
|
-
return
|
|
8341
|
+
return _context9.stop();
|
|
8129
8342
|
}
|
|
8130
8343
|
}
|
|
8131
|
-
},
|
|
8344
|
+
}, _callee9, this);
|
|
8132
8345
|
}));
|
|
8133
8346
|
|
|
8134
8347
|
function getUser() {
|
|
@@ -8164,27 +8377,27 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
8164
8377
|
}, {
|
|
8165
8378
|
key: "storeTokensFromRedirect",
|
|
8166
8379
|
value: function () {
|
|
8167
|
-
var _storeTokensFromRedirect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8380
|
+
var _storeTokensFromRedirect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
8168
8381
|
var _yield$this$token$par, tokens;
|
|
8169
8382
|
|
|
8170
|
-
return _regeneratorRuntime.wrap(function
|
|
8383
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
8171
8384
|
while (1) {
|
|
8172
|
-
switch (
|
|
8385
|
+
switch (_context10.prev = _context10.next) {
|
|
8173
8386
|
case 0:
|
|
8174
|
-
|
|
8387
|
+
_context10.next = 2;
|
|
8175
8388
|
return this.token.parseFromUrl();
|
|
8176
8389
|
|
|
8177
8390
|
case 2:
|
|
8178
|
-
_yield$this$token$par =
|
|
8391
|
+
_yield$this$token$par = _context10.sent;
|
|
8179
8392
|
tokens = _yield$this$token$par.tokens;
|
|
8180
8393
|
this.tokenManager.setTokens(tokens);
|
|
8181
8394
|
|
|
8182
8395
|
case 5:
|
|
8183
8396
|
case "end":
|
|
8184
|
-
return
|
|
8397
|
+
return _context10.stop();
|
|
8185
8398
|
}
|
|
8186
8399
|
}
|
|
8187
|
-
},
|
|
8400
|
+
}, _callee10, this);
|
|
8188
8401
|
}));
|
|
8189
8402
|
|
|
8190
8403
|
function storeTokensFromRedirect() {
|
|
@@ -8242,49 +8455,49 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
8242
8455
|
}, {
|
|
8243
8456
|
key: "handleLoginRedirect",
|
|
8244
8457
|
value: function () {
|
|
8245
|
-
var _handleLoginRedirect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8458
|
+
var _handleLoginRedirect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(tokens, originalUri) {
|
|
8246
8459
|
var state, oAuthResponse, restoreOriginalUri;
|
|
8247
|
-
return _regeneratorRuntime.wrap(function
|
|
8460
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
8248
8461
|
while (1) {
|
|
8249
|
-
switch (
|
|
8462
|
+
switch (_context11.prev = _context11.next) {
|
|
8250
8463
|
case 0:
|
|
8251
8464
|
state = this.options.state;
|
|
8252
8465
|
|
|
8253
8466
|
if (!tokens) {
|
|
8254
|
-
|
|
8467
|
+
_context11.next = 6;
|
|
8255
8468
|
break;
|
|
8256
8469
|
}
|
|
8257
8470
|
|
|
8258
8471
|
this.tokenManager.setTokens(tokens);
|
|
8259
8472
|
originalUri = originalUri || this.getOriginalUri(this.options.state);
|
|
8260
|
-
|
|
8473
|
+
_context11.next = 17;
|
|
8261
8474
|
break;
|
|
8262
8475
|
|
|
8263
8476
|
case 6:
|
|
8264
8477
|
if (!this.isLoginRedirect()) {
|
|
8265
|
-
|
|
8478
|
+
_context11.next = 16;
|
|
8266
8479
|
break;
|
|
8267
8480
|
}
|
|
8268
8481
|
|
|
8269
|
-
|
|
8482
|
+
_context11.next = 9;
|
|
8270
8483
|
return parseOAuthResponseFromUrl(this, {});
|
|
8271
8484
|
|
|
8272
8485
|
case 9:
|
|
8273
|
-
oAuthResponse =
|
|
8486
|
+
oAuthResponse = _context11.sent;
|
|
8274
8487
|
state = oAuthResponse.state;
|
|
8275
8488
|
originalUri = originalUri || this.getOriginalUri(state);
|
|
8276
|
-
|
|
8489
|
+
_context11.next = 14;
|
|
8277
8490
|
return this.storeTokensFromRedirect();
|
|
8278
8491
|
|
|
8279
8492
|
case 14:
|
|
8280
|
-
|
|
8493
|
+
_context11.next = 17;
|
|
8281
8494
|
break;
|
|
8282
8495
|
|
|
8283
8496
|
case 16:
|
|
8284
|
-
return
|
|
8497
|
+
return _context11.abrupt("return");
|
|
8285
8498
|
|
|
8286
8499
|
case 17:
|
|
8287
|
-
|
|
8500
|
+
_context11.next = 19;
|
|
8288
8501
|
return this.authStateManager.updateAuthState();
|
|
8289
8502
|
|
|
8290
8503
|
case 19:
|
|
@@ -8292,15 +8505,15 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
8292
8505
|
restoreOriginalUri = this.options.restoreOriginalUri;
|
|
8293
8506
|
|
|
8294
8507
|
if (!restoreOriginalUri) {
|
|
8295
|
-
|
|
8508
|
+
_context11.next = 26;
|
|
8296
8509
|
break;
|
|
8297
8510
|
}
|
|
8298
8511
|
|
|
8299
|
-
|
|
8512
|
+
_context11.next = 24;
|
|
8300
8513
|
return restoreOriginalUri(this, originalUri);
|
|
8301
8514
|
|
|
8302
8515
|
case 24:
|
|
8303
|
-
|
|
8516
|
+
_context11.next = 27;
|
|
8304
8517
|
break;
|
|
8305
8518
|
|
|
8306
8519
|
case 26:
|
|
@@ -8308,10 +8521,10 @@ var OktaAuth = /*#__PURE__*/function () {
|
|
|
8308
8521
|
|
|
8309
8522
|
case 27:
|
|
8310
8523
|
case "end":
|
|
8311
|
-
return
|
|
8524
|
+
return _context11.stop();
|
|
8312
8525
|
}
|
|
8313
8526
|
}
|
|
8314
|
-
},
|
|
8527
|
+
}, _callee11, this);
|
|
8315
8528
|
}));
|
|
8316
8529
|
|
|
8317
8530
|
function handleLoginRedirect(_x6, _x7) {
|