@okta/okta-auth-js 7.4.3 → 7.5.1
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 +22 -0
- package/README.md +1 -1
- package/cjs/browser/fingerprint.js +1 -2
- package/cjs/browser/fingerprint.js.map +1 -1
- package/cjs/core/ServiceManager/browser.js +3 -4
- package/cjs/core/ServiceManager/browser.js.map +1 -1
- package/cjs/core/types/api.js.map +1 -1
- package/cjs/fetch/fetchRequest.js +1 -2
- package/cjs/fetch/fetchRequest.js.map +1 -1
- package/cjs/http/OktaUserAgent.js +2 -2
- package/cjs/http/request.js +11 -5
- package/cjs/http/request.js.map +1 -1
- package/cjs/http/types.js.map +1 -1
- package/cjs/idx/IdxTransactionManager.js +1 -1
- package/cjs/idx/IdxTransactionManager.js.map +1 -1
- package/cjs/idx/authenticator/OktaPassword.js +1 -2
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +1 -2
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/getAuthenticator.js +3 -4
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
- package/cjs/idx/factory/MinimalOktaAuthIdx.js +20 -0
- package/cjs/idx/factory/MinimalOktaAuthIdx.js.map +1 -0
- package/cjs/idx/factory/api.js +9 -0
- package/cjs/idx/factory/api.js.map +1 -1
- package/cjs/idx/factory/index.js +11 -0
- package/cjs/idx/factory/index.js.map +1 -1
- package/cjs/idx/factory/minimalApi.js +41 -0
- package/cjs/idx/factory/minimalApi.js.map +1 -0
- package/cjs/idx/flow/AccountUnlockFlow.js +2 -1
- package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -1
- package/cjs/idx/flow/AuthenticationFlow.js +1 -0
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/PasswordRecoveryFlow.js +1 -0
- package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
- package/cjs/idx/idxState/index.js +1 -1
- package/cjs/idx/idxState/index.js.map +1 -1
- package/cjs/idx/idxState/v1/generateIdxAction.js +2 -2
- package/cjs/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/cjs/idx/idxState/v1/idxResponseParser.js +11 -10
- package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/cjs/idx/idxState/v1/makeIdxState.js +1 -2
- package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/cjs/idx/idxState/v1/parsers.js +1 -4
- package/cjs/idx/idxState/v1/parsers.js.map +1 -1
- package/cjs/idx/idxState/v1/remediationParser.js +4 -5
- package/cjs/idx/idxState/v1/remediationParser.js.map +1 -1
- package/cjs/idx/interact.js +1 -2
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/mixinMinimal.js +19 -0
- package/cjs/idx/mixinMinimal.js.map +1 -0
- package/cjs/idx/poll.js +3 -5
- package/cjs/idx/poll.js.map +1 -1
- package/cjs/idx/proceed.js +1 -1
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +5 -7
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +3 -4
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +1 -2
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/EnrollPoll.js +1 -1
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticatorWarning.js +22 -0
- package/cjs/idx/remediators/ReEnrollAuthenticatorWarning.js.map +1 -0
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +2 -3
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +2 -3
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollmentChannel.js +1 -2
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/cjs/idx/remediators/index.js +11 -0
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/remediators/util.js +2 -4
- package/cjs/idx/remediators/util.js.map +1 -1
- package/cjs/idx/run.js +7 -10
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/transactionMeta.js +1 -1
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/FlowSpecification.js +2 -0
- package/cjs/idx/types/FlowSpecification.js.map +1 -0
- package/cjs/idx/types/api.js.map +1 -1
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/util.js +23 -10
- package/cjs/idx/util.js.map +1 -1
- package/cjs/myaccount/emailApi.js +11 -15
- package/cjs/myaccount/emailApi.js.map +1 -1
- package/cjs/myaccount/passwordApi.js +8 -10
- package/cjs/myaccount/passwordApi.js.map +1 -1
- package/cjs/myaccount/phoneApi.js +7 -9
- package/cjs/myaccount/phoneApi.js.map +1 -1
- package/cjs/myaccount/profileApi.js +7 -9
- package/cjs/myaccount/profileApi.js.map +1 -1
- package/cjs/myaccount/request.js +18 -27
- package/cjs/myaccount/request.js.map +1 -1
- package/cjs/myaccount/transactions/Base.js.map +1 -1
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js +4 -4
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/EmailTransaction.js +8 -9
- package/cjs/myaccount/transactions/EmailTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/PasswordTransaction.js +6 -9
- package/cjs/myaccount/transactions/PasswordTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/PhoneTransaction.js +2 -3
- package/cjs/myaccount/transactions/PhoneTransaction.js.map +1 -1
- package/cjs/myaccount/types.js +1 -52
- package/cjs/myaccount/types.js.map +1 -1
- package/cjs/oidc/TokenManager.js +4 -4
- package/cjs/oidc/TokenManager.js.map +1 -1
- package/cjs/oidc/TransactionManager.js +1 -1
- package/cjs/oidc/TransactionManager.js.map +1 -1
- package/cjs/oidc/factory/baseApi.js +29 -0
- package/cjs/oidc/factory/baseApi.js.map +1 -0
- package/cjs/oidc/getToken.js +1 -2
- package/cjs/oidc/getToken.js.map +1 -1
- package/cjs/oidc/introspect.js +3 -5
- package/cjs/oidc/introspect.js.map +1 -1
- package/cjs/oidc/mixin/index.js +6 -13
- package/cjs/oidc/mixin/index.js.map +1 -1
- package/cjs/oidc/mixin/minimal.js +29 -0
- package/cjs/oidc/mixin/minimal.js.map +1 -0
- package/cjs/oidc/renewTokens.js +1 -2
- package/cjs/oidc/renewTokens.js.map +1 -1
- package/cjs/oidc/types/api.js.map +1 -1
- package/cjs/oidc/util/errors.js +2 -2
- package/cjs/oidc/util/errors.js.map +1 -1
- package/cjs/oidc/util/loginRedirect.js +10 -0
- package/cjs/oidc/util/loginRedirect.js.map +1 -1
- package/cjs/oidc/util/validateClaims.js +1 -1
- package/cjs/oidc/util/validateClaims.js.map +1 -1
- package/cjs/oidc/verifyToken.js +1 -1
- package/cjs/oidc/verifyToken.js.map +1 -1
- package/cjs/services/LeaderElectionService.js +3 -6
- package/cjs/services/LeaderElectionService.js.map +1 -1
- package/cjs/services/SyncStorageService.js +6 -11
- package/cjs/services/SyncStorageService.js.map +1 -1
- package/dist/okta-auth-js.authn.min.analyzer.html +2 -2
- package/dist/okta-auth-js.authn.min.js +1 -1
- package/dist/okta-auth-js.authn.min.js.map +1 -1
- package/dist/okta-auth-js.core.min.analyzer.html +2 -2
- package/dist/okta-auth-js.core.min.js +1 -1
- package/dist/okta-auth-js.core.min.js.map +1 -1
- package/dist/okta-auth-js.idx.min.analyzer.html +2 -2
- package/dist/okta-auth-js.idx.min.js +1 -1
- package/dist/okta-auth-js.idx.min.js.map +1 -1
- package/dist/okta-auth-js.min.analyzer.html +2 -2
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.myaccount.min.analyzer.html +2 -2
- package/dist/okta-auth-js.myaccount.min.js +1 -1
- package/dist/okta-auth-js.myaccount.min.js.map +1 -1
- package/esm/browser/exports/exports/authn.js +1 -1
- package/esm/browser/exports/exports/core.js +1 -1
- package/esm/browser/exports/exports/default.js +2 -9
- package/esm/browser/exports/exports/default.js.map +1 -1
- package/esm/browser/exports/exports/idx.js +2 -1
- package/esm/browser/exports/exports/idx.js.map +1 -1
- package/esm/browser/exports/exports/myaccount.js +1 -9
- package/esm/browser/exports/exports/myaccount.js.map +1 -1
- package/esm/browser/http/OktaUserAgent.js +2 -2
- package/esm/browser/http/request.js +7 -1
- package/esm/browser/http/request.js.map +1 -1
- package/esm/browser/idx/cancel.js +1 -0
- package/esm/browser/idx/cancel.js.map +1 -1
- package/esm/browser/idx/factory/MinimalOktaAuthIdx.js +31 -0
- package/esm/browser/idx/factory/MinimalOktaAuthIdx.js.map +1 -0
- package/esm/browser/idx/factory/api.js +7 -0
- package/esm/browser/idx/factory/api.js.map +1 -1
- package/esm/browser/idx/factory/minimalApi.js +38 -0
- package/esm/browser/idx/factory/minimalApi.js.map +1 -0
- package/esm/browser/idx/flow/AccountUnlockFlow.js +2 -0
- package/esm/browser/idx/flow/AccountUnlockFlow.js.map +1 -1
- package/esm/browser/idx/flow/AuthenticationFlow.js +2 -0
- package/esm/browser/idx/flow/AuthenticationFlow.js.map +1 -1
- package/esm/browser/idx/flow/FlowSpecification.js.map +1 -1
- package/esm/browser/idx/flow/PasswordRecoveryFlow.js +2 -0
- package/esm/browser/idx/flow/PasswordRecoveryFlow.js.map +1 -1
- package/esm/browser/idx/flow/RegistrationFlow.js +1 -0
- package/esm/browser/idx/flow/RegistrationFlow.js.map +1 -1
- package/esm/browser/idx/idxState/v1/idxResponseParser.js +4 -4
- package/esm/browser/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/esm/browser/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/esm/browser/idx/idxState/v1/parsers.js.map +1 -1
- package/esm/browser/idx/idxState/v1/remediationParser.js +1 -6
- package/esm/browser/idx/idxState/v1/remediationParser.js.map +1 -1
- package/esm/browser/idx/mixinMinimal.js +29 -0
- package/esm/browser/idx/mixinMinimal.js.map +1 -0
- package/esm/browser/idx/recoverPassword.js +1 -0
- package/esm/browser/idx/recoverPassword.js.map +1 -1
- package/esm/browser/idx/remediators/Base/Remediator.js.map +1 -1
- package/esm/browser/idx/remediators/Identify.js.map +1 -1
- package/esm/browser/idx/remediators/ReEnrollAuthenticatorWarning.js +20 -0
- package/esm/browser/idx/remediators/ReEnrollAuthenticatorWarning.js.map +1 -0
- package/esm/browser/idx/remediators/index.js +1 -0
- package/esm/browser/idx/remediators/index.js.map +1 -1
- package/esm/browser/idx/run.js +4 -22
- package/esm/browser/idx/run.js.map +1 -1
- package/esm/browser/idx/types/api.js.map +1 -1
- package/esm/browser/idx/util.js +16 -3
- package/esm/browser/idx/util.js.map +1 -1
- package/esm/browser/myaccount/emailApi.js +9 -11
- package/esm/browser/myaccount/emailApi.js.map +1 -1
- package/esm/browser/myaccount/passwordApi.js +4 -6
- package/esm/browser/myaccount/passwordApi.js.map +1 -1
- package/esm/browser/myaccount/phoneApi.js +5 -6
- package/esm/browser/myaccount/phoneApi.js.map +1 -1
- package/esm/browser/myaccount/profileApi.js +6 -6
- package/esm/browser/myaccount/profileApi.js.map +1 -1
- package/esm/browser/myaccount/request.js +13 -28
- package/esm/browser/myaccount/request.js.map +1 -1
- package/esm/browser/myaccount/transactions/Base.js.map +1 -1
- package/esm/browser/myaccount/transactions/EmailChallengeTransaction.js +3 -3
- package/esm/browser/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
- package/esm/browser/myaccount/transactions/EmailTransaction.js +5 -6
- package/esm/browser/myaccount/transactions/EmailTransaction.js.map +1 -1
- package/esm/browser/myaccount/transactions/PasswordTransaction.js +3 -6
- package/esm/browser/myaccount/transactions/PasswordTransaction.js.map +1 -1
- package/esm/browser/myaccount/transactions/PhoneTransaction.js +1 -2
- package/esm/browser/myaccount/transactions/PhoneTransaction.js.map +1 -1
- package/esm/browser/myaccount/types.js +0 -4
- package/esm/browser/myaccount/types.js.map +1 -1
- package/esm/browser/oidc/TokenManager.js +3 -2
- package/esm/browser/oidc/TokenManager.js.map +1 -1
- package/esm/browser/oidc/factory/baseApi.js +28 -0
- package/esm/browser/oidc/factory/baseApi.js.map +1 -0
- package/esm/browser/oidc/introspect.js +1 -1
- package/esm/browser/oidc/introspect.js.map +1 -1
- package/esm/browser/oidc/mixin/index.js +2 -9
- package/esm/browser/oidc/mixin/index.js.map +1 -1
- package/esm/browser/oidc/mixin/minimal.js +45 -0
- package/esm/browser/oidc/mixin/minimal.js.map +1 -0
- package/esm/browser/oidc/util/loginRedirect.js +11 -1
- package/esm/browser/oidc/util/loginRedirect.js.map +1 -1
- package/esm/browser/oidc/util/validateClaims.js +2 -1
- package/esm/browser/oidc/util/validateClaims.js.map +1 -1
- package/esm/browser/package.json +1 -1
- package/esm/node/exports/exports/authn.js +1 -1
- package/esm/node/exports/exports/core.js +1 -1
- package/esm/node/exports/exports/default.js +2 -9
- package/esm/node/exports/exports/default.js.map +1 -1
- package/esm/node/exports/exports/idx.js +2 -1
- package/esm/node/exports/exports/idx.js.map +1 -1
- package/esm/node/exports/exports/myaccount.js +1 -9
- package/esm/node/exports/exports/myaccount.js.map +1 -1
- package/esm/node/fetch/fetchRequest.js +1 -1
- package/esm/node/fetch/fetchRequest.js.map +1 -1
- package/esm/node/http/OktaUserAgent.js +2 -2
- package/esm/node/http/request.js +7 -1
- package/esm/node/http/request.js.map +1 -1
- package/esm/node/idx/cancel.js +1 -0
- package/esm/node/idx/cancel.js.map +1 -1
- package/esm/node/idx/factory/MinimalOktaAuthIdx.js +31 -0
- package/esm/node/idx/factory/MinimalOktaAuthIdx.js.map +1 -0
- package/esm/node/idx/factory/api.js +7 -0
- package/esm/node/idx/factory/api.js.map +1 -1
- package/esm/node/idx/factory/minimalApi.js +38 -0
- package/esm/node/idx/factory/minimalApi.js.map +1 -0
- package/esm/node/idx/flow/AccountUnlockFlow.js +2 -0
- package/esm/node/idx/flow/AccountUnlockFlow.js.map +1 -1
- package/esm/node/idx/flow/AuthenticationFlow.js +2 -0
- package/esm/node/idx/flow/AuthenticationFlow.js.map +1 -1
- package/esm/node/idx/flow/FlowSpecification.js.map +1 -1
- package/esm/node/idx/flow/PasswordRecoveryFlow.js +2 -0
- package/esm/node/idx/flow/PasswordRecoveryFlow.js.map +1 -1
- package/esm/node/idx/flow/RegistrationFlow.js +1 -0
- package/esm/node/idx/flow/RegistrationFlow.js.map +1 -1
- package/esm/node/idx/idxState/v1/idxResponseParser.js +4 -4
- package/esm/node/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/esm/node/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/esm/node/idx/idxState/v1/parsers.js.map +1 -1
- package/esm/node/idx/idxState/v1/remediationParser.js +1 -6
- package/esm/node/idx/idxState/v1/remediationParser.js.map +1 -1
- package/esm/node/idx/mixinMinimal.js +29 -0
- package/esm/node/idx/mixinMinimal.js.map +1 -0
- package/esm/node/idx/recoverPassword.js +1 -0
- package/esm/node/idx/recoverPassword.js.map +1 -1
- package/esm/node/idx/remediators/Base/Remediator.js.map +1 -1
- package/esm/node/idx/remediators/Identify.js.map +1 -1
- package/esm/node/idx/remediators/ReEnrollAuthenticatorWarning.js +20 -0
- package/esm/node/idx/remediators/ReEnrollAuthenticatorWarning.js.map +1 -0
- package/esm/node/idx/remediators/index.js +1 -0
- package/esm/node/idx/remediators/index.js.map +1 -1
- package/esm/node/idx/run.js +4 -22
- package/esm/node/idx/run.js.map +1 -1
- package/esm/node/idx/types/api.js.map +1 -1
- package/esm/node/idx/util.js +16 -3
- package/esm/node/idx/util.js.map +1 -1
- package/esm/node/myaccount/emailApi.js +9 -11
- package/esm/node/myaccount/emailApi.js.map +1 -1
- package/esm/node/myaccount/passwordApi.js +4 -6
- package/esm/node/myaccount/passwordApi.js.map +1 -1
- package/esm/node/myaccount/phoneApi.js +5 -6
- package/esm/node/myaccount/phoneApi.js.map +1 -1
- package/esm/node/myaccount/profileApi.js +6 -6
- package/esm/node/myaccount/profileApi.js.map +1 -1
- package/esm/node/myaccount/request.js +13 -28
- package/esm/node/myaccount/request.js.map +1 -1
- package/esm/node/myaccount/transactions/Base.js.map +1 -1
- package/esm/node/myaccount/transactions/EmailChallengeTransaction.js +3 -3
- package/esm/node/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
- package/esm/node/myaccount/transactions/EmailTransaction.js +5 -6
- package/esm/node/myaccount/transactions/EmailTransaction.js.map +1 -1
- package/esm/node/myaccount/transactions/PasswordTransaction.js +3 -6
- package/esm/node/myaccount/transactions/PasswordTransaction.js.map +1 -1
- package/esm/node/myaccount/transactions/PhoneTransaction.js +1 -2
- package/esm/node/myaccount/transactions/PhoneTransaction.js.map +1 -1
- package/esm/node/myaccount/types.js +0 -5
- package/esm/node/myaccount/types.js.map +1 -1
- package/esm/node/oidc/TokenManager.js +3 -2
- package/esm/node/oidc/TokenManager.js.map +1 -1
- package/esm/node/oidc/factory/baseApi.js +29 -0
- package/esm/node/oidc/factory/baseApi.js.map +1 -0
- package/esm/node/oidc/introspect.js +1 -1
- package/esm/node/oidc/introspect.js.map +1 -1
- package/esm/node/oidc/mixin/index.js +2 -9
- package/esm/node/oidc/mixin/index.js.map +1 -1
- package/esm/node/oidc/mixin/minimal.js +46 -0
- package/esm/node/oidc/mixin/minimal.js.map +1 -0
- package/esm/node/oidc/util/loginRedirect.js +11 -1
- package/esm/node/oidc/util/loginRedirect.js.map +1 -1
- package/esm/node/oidc/util/validateClaims.js +2 -1
- package/esm/node/oidc/util/validateClaims.js.map +1 -1
- package/esm/node/package.json +1 -1
- package/package.json +4 -4
- package/types/lib/core/types/api.d.ts +1 -0
- package/types/lib/http/types.d.ts +1 -1
- package/types/lib/idx/factory/MinimalOktaAuthIdx.d.ts +8 -0
- package/types/lib/idx/factory/index.d.ts +1 -0
- package/types/lib/idx/factory/minimalApi.d.ts +14 -0
- package/types/lib/idx/flow/FlowSpecification.d.ts +1 -8
- package/types/lib/idx/idxState/v1/idxResponseParser.d.ts +4 -3
- package/types/lib/idx/idxState/v1/remediationParser.d.ts +2 -2
- package/types/lib/idx/mixinMinimal.d.ts +6 -0
- package/types/lib/idx/remediators/Base/Remediator.d.ts +1 -0
- package/types/lib/idx/remediators/Identify.d.ts +1 -0
- package/types/lib/idx/remediators/ReEnrollAuthenticatorWarning.d.ts +15 -0
- package/types/lib/idx/remediators/index.d.ts +1 -0
- package/types/lib/idx/types/FlowSpecification.d.ts +8 -0
- package/types/lib/idx/types/api.d.ts +18 -2
- package/types/lib/idx/types/index.d.ts +1 -0
- package/types/lib/idx/util.d.ts +10 -2
- package/types/lib/myaccount/emailApi.d.ts +2 -1
- package/types/lib/myaccount/passwordApi.d.ts +2 -1
- package/types/lib/myaccount/phoneApi.d.ts +2 -1
- package/types/lib/myaccount/profileApi.d.ts +2 -1
- package/types/lib/myaccount/request.d.ts +4 -16
- package/types/lib/myaccount/transactions/Base.d.ts +14 -1
- package/types/lib/myaccount/transactions/EmailTransaction.d.ts +2 -1
- package/types/lib/myaccount/types.d.ts +1 -1
- package/types/lib/oidc/factory/baseApi.d.ts +14 -0
- package/types/lib/oidc/mixin/minimal.d.ts +4 -0
- package/types/lib/oidc/types/api.d.ts +8 -0
- package/types/lib/oidc/util/loginRedirect.d.ts +2 -1
- package/umd/authn.js +1 -1
- package/umd/authn.js.map +1 -1
- package/umd/core.js +1 -1
- package/umd/core.js.map +1 -1
- package/umd/default.js +1 -1
- package/umd/default.js.map +1 -1
- package/umd/idx.js +1 -1
- package/umd/idx.js.map +1 -1
- package/umd/myaccount.js +1 -1
- package/umd/myaccount.js.map +1 -1
package/cjs/idx/proceed.js
CHANGED
|
@@ -33,7 +33,7 @@ async function proceed(authClient, options = {}) {
|
|
|
33
33
|
const meta = (0, _transactionMeta.getSavedTransactionMeta)(authClient, {
|
|
34
34
|
state
|
|
35
35
|
});
|
|
36
|
-
flow = meta
|
|
36
|
+
flow = meta?.flow;
|
|
37
37
|
}
|
|
38
38
|
return (0, _run.run)(authClient, {
|
|
39
39
|
...options,
|
package/cjs/idx/proceed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proceed.js","names":["canProceed","authClient","options","meta","getSavedTransactionMeta","stateHandle","proceed","AuthSdkError","flow","state","run"],"sources":["../../../lib/idx/proceed.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { \n OktaAuthIdxInterface,\n IdxTransaction,\n ProceedOptions,\n} from './types';\nimport { run } from './run';\nimport { getSavedTransactionMeta } from './transactionMeta';\nimport { AuthSdkError } from '../errors';\n\nexport function canProceed(authClient: OktaAuthIdxInterface, options: ProceedOptions = {}): boolean {\n const meta = getSavedTransactionMeta(authClient, options);\n return !!(meta || options.stateHandle);\n}\n\nexport async function proceed(\n authClient: OktaAuthIdxInterface,\n options: ProceedOptions = {}\n): Promise<IdxTransaction> {\n\n if (!canProceed(authClient, options)) {\n throw new AuthSdkError('Unable to proceed: saved transaction could not be loaded');\n }\n\n let { flow, state } = options;\n if (!flow) {\n const meta = getSavedTransactionMeta(authClient, { state });\n flow = meta?.flow;\n }\n\n return run(authClient, { \n ...options, \n flow\n });\n}\n"],"mappings":";;;;AAkBA;AACA;AACA;AApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,SAASA,UAAU,CAACC,UAAgC,EAAEC,OAAuB,GAAG,CAAC,CAAC,EAAW;EAClG,MAAMC,IAAI,GAAG,IAAAC,wCAAuB,EAACH,UAAU,EAAEC,OAAO,CAAC;EACzD,OAAO,CAAC,EAAEC,IAAI,IAAID,OAAO,CAACG,WAAW,CAAC;AACxC;AAEO,eAAeC,OAAO,CAC3BL,UAAgC,EAChCC,OAAuB,GAAG,CAAC,CAAC,EACH;EAEzB,IAAI,CAACF,UAAU,CAACC,UAAU,EAAEC,OAAO,CAAC,EAAE;IACpC,MAAM,IAAIK,oBAAY,CAAC,0DAA0D,CAAC;EACpF;EAEA,IAAI;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGP,OAAO;EAC7B,IAAI,CAACM,IAAI,EAAE;IACT,MAAML,IAAI,GAAG,IAAAC,wCAAuB,EAACH,UAAU,EAAE;MAAEQ;IAAM,CAAC,CAAC;IAC3DD,IAAI,GAAGL,IAAI,
|
|
1
|
+
{"version":3,"file":"proceed.js","names":["canProceed","authClient","options","meta","getSavedTransactionMeta","stateHandle","proceed","AuthSdkError","flow","state","run"],"sources":["../../../lib/idx/proceed.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { \n OktaAuthIdxInterface,\n IdxTransaction,\n ProceedOptions,\n} from './types';\nimport { run } from './run';\nimport { getSavedTransactionMeta } from './transactionMeta';\nimport { AuthSdkError } from '../errors';\n\nexport function canProceed(authClient: OktaAuthIdxInterface, options: ProceedOptions = {}): boolean {\n const meta = getSavedTransactionMeta(authClient, options);\n return !!(meta || options.stateHandle);\n}\n\nexport async function proceed(\n authClient: OktaAuthIdxInterface,\n options: ProceedOptions = {}\n): Promise<IdxTransaction> {\n\n if (!canProceed(authClient, options)) {\n throw new AuthSdkError('Unable to proceed: saved transaction could not be loaded');\n }\n\n let { flow, state } = options;\n if (!flow) {\n const meta = getSavedTransactionMeta(authClient, { state });\n flow = meta?.flow;\n }\n\n return run(authClient, { \n ...options, \n flow\n });\n}\n"],"mappings":";;;;AAkBA;AACA;AACA;AApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,SAASA,UAAU,CAACC,UAAgC,EAAEC,OAAuB,GAAG,CAAC,CAAC,EAAW;EAClG,MAAMC,IAAI,GAAG,IAAAC,wCAAuB,EAACH,UAAU,EAAEC,OAAO,CAAC;EACzD,OAAO,CAAC,EAAEC,IAAI,IAAID,OAAO,CAACG,WAAW,CAAC;AACxC;AAEO,eAAeC,OAAO,CAC3BL,UAAgC,EAChCC,OAAuB,GAAG,CAAC,CAAC,EACH;EAEzB,IAAI,CAACF,UAAU,CAACC,UAAU,EAAEC,OAAO,CAAC,EAAE;IACpC,MAAM,IAAIK,oBAAY,CAAC,0DAA0D,CAAC;EACpF;EAEA,IAAI;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGP,OAAO;EAC7B,IAAI,CAACM,IAAI,EAAE;IACT,MAAML,IAAI,GAAG,IAAAC,wCAAuB,EAACH,UAAU,EAAE;MAAEQ;IAAM,CAAC,CAAC;IAC3DD,IAAI,GAAGL,IAAI,EAAEK,IAAI;EACnB;EAEA,OAAO,IAAAE,QAAG,EAACT,UAAU,EAAE;IACrB,GAAGC,OAAO;IACVM;EACF,CAAC,CAAC;AACJ"}
|
|
@@ -55,7 +55,7 @@ class AuthenticatorData extends _Remediator.Remediator {
|
|
|
55
55
|
authenticator
|
|
56
56
|
} = this.values;
|
|
57
57
|
if (!methodType && (0, _api.isAuthenticator)(authenticator)) {
|
|
58
|
-
methodType = authenticator
|
|
58
|
+
methodType = authenticator?.methodType;
|
|
59
59
|
}
|
|
60
60
|
const {
|
|
61
61
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticatorData.js","names":["AuthenticatorData","Remediator","constructor","remediation","values","authenticator","getAuthenticator","formatAuthenticatorData","authenticatorData","getAuthenticatorData","authenticatorsData","map","data","compareAuthenticators","mapAuthenticatorDataFromValues","push","find","canRemediate","some","methodType","isAuthenticator","id","enrollmentId","getAuthenticatorFromRemediation","value","name","getValuesAfterProceed","filter"],"sources":["../../../../../lib/idx/remediators/Base/AuthenticatorData.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { IdxRemediationValue, IdxRemediation, IdxAuthenticator } from '../../types/idx-js';\nimport { isAuthenticator } from '../../types/api';\nimport { compareAuthenticators } from '../../authenticator/util';\n\nexport type AuthenticatorDataValues = RemediationValues & {\n methodType?: string;\n};\n\n// Base class - DO NOT expose static remediationName\nexport class AuthenticatorData<T extends AuthenticatorDataValues = AuthenticatorDataValues> extends Remediator<T> {\n authenticator: IdxAuthenticator;\n\n constructor(remediation: IdxRemediation, values: T = {} as T) {\n super(remediation, values);\n\n // set before other data calculation\n this.authenticator = this.getAuthenticator()!;\n\n this.formatAuthenticatorData();\n }\n\n protected formatAuthenticatorData() {\n const authenticatorData = this.getAuthenticatorData();\n if (authenticatorData) {\n this.values.authenticatorsData = this.values.authenticatorsData!.map(data => {\n if (compareAuthenticators(this.authenticator, data)) {\n return this.mapAuthenticatorDataFromValues(data);\n }\n return data;\n });\n } else {\n const data = this.mapAuthenticatorDataFromValues();\n if (data) {\n this.values.authenticatorsData!.push(data);\n }\n }\n }\n\n protected getAuthenticatorData() {\n return this.values.authenticatorsData!\n .find((data) => compareAuthenticators(this.authenticator, data));\n }\n\n canRemediate() {\n return this.values.authenticatorsData!\n .some(data => compareAuthenticators(this.authenticator, data));\n }\n\n protected mapAuthenticatorDataFromValues(authenticatorData?) {\n // add methodType to authenticatorData if it exists in values\n let { methodType, authenticator } = this.values;\n if (!methodType && isAuthenticator(authenticator)) {\n methodType = authenticator?.methodType;\n }\n \n const { id, enrollmentId } = this.authenticator;\n const data = { \n id,\n enrollmentId,\n ...(authenticatorData && authenticatorData),\n ...(methodType && { methodType }) \n };\n\n return data.methodType ? data : null;\n }\n\n protected getAuthenticatorFromRemediation(): IdxRemediationValue {\n const authenticator = this.remediation.value!\n .find(({ name }) => name === 'authenticator') as IdxRemediationValue;\n return authenticator;\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n // remove used authenticatorData\n const authenticatorsData = this.values.authenticatorsData!\n .filter(data => compareAuthenticators(this.authenticator, data) !== true);\n return { ...this.values, authenticatorsData };\n }\n}\n"],"mappings":";;;AAaA;AAEA;AACA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACO,MAAMA,iBAAiB,SAAsEC,sBAAU,CAAI;EAGhHC,WAAW,CAACC,WAA2B,EAAEC,MAAS,GAAG,CAAC,CAAM,EAAE;IAC5D,KAAK,CAACD,WAAW,EAAEC,MAAM,CAAC;;IAE1B;I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orData.js","names":["AuthenticatorData","Remediator","constructor","remediation","values","authenticator","getAuthenticator","formatAuthenticatorData","authenticatorData","getAuthenticatorData","authenticatorsData","map","data","compareAuthenticators","mapAuthenticatorDataFromValues","push","find","canRemediate","some","methodType","isAuthenticator","id","enrollmentId","getAuthenticatorFromRemediation","value","name","getValuesAfterProceed","filter"],"sources":["../../../../../lib/idx/remediators/Base/AuthenticatorData.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { IdxRemediationValue, IdxRemediation, IdxAuthenticator } from '../../types/idx-js';\nimport { isAuthenticator } from '../../types/api';\nimport { compareAuthenticators } from '../../authenticator/util';\n\nexport type AuthenticatorDataValues = RemediationValues & {\n methodType?: string;\n};\n\n// Base class - DO NOT expose static remediationName\nexport class AuthenticatorData<T extends AuthenticatorDataValues = AuthenticatorDataValues> extends Remediator<T> {\n authenticator: IdxAuthenticator;\n\n constructor(remediation: IdxRemediation, values: T = {} as T) {\n super(remediation, values);\n\n // set before other data calculation\n this.authenticator = this.getAuthenticator()!;\n\n this.formatAuthenticatorData();\n }\n\n protected formatAuthenticatorData() {\n const authenticatorData = this.getAuthenticatorData();\n if (authenticatorData) {\n this.values.authenticatorsData = this.values.authenticatorsData!.map(data => {\n if (compareAuthenticators(this.authenticator, data)) {\n return this.mapAuthenticatorDataFromValues(data);\n }\n return data;\n });\n } else {\n const data = this.mapAuthenticatorDataFromValues();\n if (data) {\n this.values.authenticatorsData!.push(data);\n }\n }\n }\n\n protected getAuthenticatorData() {\n return this.values.authenticatorsData!\n .find((data) => compareAuthenticators(this.authenticator, data));\n }\n\n canRemediate() {\n return this.values.authenticatorsData!\n .some(data => compareAuthenticators(this.authenticator, data));\n }\n\n protected mapAuthenticatorDataFromValues(authenticatorData?) {\n // add methodType to authenticatorData if it exists in values\n let { methodType, authenticator } = this.values;\n if (!methodType && isAuthenticator(authenticator)) {\n methodType = authenticator?.methodType;\n }\n \n const { id, enrollmentId } = this.authenticator;\n const data = { \n id,\n enrollmentId,\n ...(authenticatorData && authenticatorData),\n ...(methodType && { methodType }) \n };\n\n return data.methodType ? data : null;\n }\n\n protected getAuthenticatorFromRemediation(): IdxRemediationValue {\n const authenticator = this.remediation.value!\n .find(({ name }) => name === 'authenticator') as IdxRemediationValue;\n return authenticator;\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n // remove used authenticatorData\n const authenticatorsData = this.values.authenticatorsData!\n .filter(data => compareAuthenticators(this.authenticator, data) !== true);\n return { ...this.values, authenticatorsData };\n }\n}\n"],"mappings":";;;AAaA;AAEA;AACA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACO,MAAMA,iBAAiB,SAAsEC,sBAAU,CAAI;EAGhHC,WAAW,CAACC,WAA2B,EAAEC,MAAS,GAAG,CAAC,CAAM,EAAE;IAC5D,KAAK,CAACD,WAAW,EAAEC,MAAM,CAAC;;IAE1B;IACA,IAAI,CAACC,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAG;IAE7C,IAAI,CAACC,uBAAuB,EAAE;EAChC;EAEUA,uBAAuB,GAAG;IAClC,MAAMC,iBAAiB,GAAG,IAAI,CAACC,oBAAoB,EAAE;IACrD,IAAID,iBAAiB,EAAE;MACrB,IAAI,CAACJ,MAAM,CAACM,kBAAkB,GAAG,IAAI,CAACN,MAAM,CAACM,kBAAkB,CAAEC,GAAG,CAACC,IAAI,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AAMlB,aAAa,GAAG,IAAI,CAACF,WAAW,CAACqB,KAAK,CACzCR,IAAI,CAAC,CAAC;MAAES;IAAK,CAAC,KAAKA,IAAI,KAAK,eAAe,CAAwB;IACtE,OAAOpB,aAAa;EACtB;EAEAqB,qBAAqB,GAAM;IACzB,IAAI,CAACtB,MAAM,GAAG,KAAK,CAACsB,qBAAqB,EAAE;IAC3C;IACA,MAAMhB,kBAAkB,GAAG,IAAI,CAACN,MAAM,CAACM,kBAAkB,CACtDiB,MAAM,CAACf,IAAI,IAAI,IAAAC,2BAAqB,EAAC,IAAI,CAACR,aAAa,EAAEO,IAAI,CAAC,KAAK,IAAI,CAAC;IAC3E,OAAO;MAAE,GAAG,IAAI,CAACR,MAAM;MAAEM;IAAmB,CAAC;EAC/C;AACF;AAAC"}
|
|
@@ -121,7 +121,7 @@ class Remediator {
|
|
|
121
121
|
const authenticator = this.getAuthenticator();
|
|
122
122
|
// TODO: remove type field in the next major version change
|
|
123
123
|
// https://oktainc.atlassian.net/browse/OKTA-431749
|
|
124
|
-
const type = authenticator
|
|
124
|
+
const type = authenticator?.type;
|
|
125
125
|
return {
|
|
126
126
|
name,
|
|
127
127
|
inputs,
|
|
@@ -185,11 +185,10 @@ class Remediator {
|
|
|
185
185
|
return inputs;
|
|
186
186
|
}
|
|
187
187
|
static getMessages(remediation) {
|
|
188
|
-
var _remediation$value$, _remediation$value$$f;
|
|
189
188
|
if (!remediation.value) {
|
|
190
189
|
return;
|
|
191
190
|
}
|
|
192
|
-
return
|
|
191
|
+
return remediation.value[0]?.form?.value.reduce((messages, field) => {
|
|
193
192
|
if (field.messages) {
|
|
194
193
|
messages = [...messages, ...field.messages.value];
|
|
195
194
|
}
|
|
@@ -211,9 +210,8 @@ class Remediator {
|
|
|
211
210
|
return this.values;
|
|
212
211
|
}
|
|
213
212
|
getAuthenticator() {
|
|
214
|
-
var _this$remediation$rel, _value$find;
|
|
215
213
|
// relatesTo value may be an authenticator or an authenticatorEnrollment
|
|
216
|
-
const relatesTo =
|
|
214
|
+
const relatesTo = this.remediation.relatesTo?.value;
|
|
217
215
|
if (!relatesTo) {
|
|
218
216
|
return;
|
|
219
217
|
}
|
|
@@ -228,9 +226,9 @@ class Remediator {
|
|
|
228
226
|
const id = authenticatorFromRemediation.form.value.find(({
|
|
229
227
|
name
|
|
230
228
|
}) => name === 'id').value;
|
|
231
|
-
const enrollmentId =
|
|
229
|
+
const enrollmentId = authenticatorFromRemediation.form.value.find(({
|
|
232
230
|
name
|
|
233
|
-
}) => name === 'enrollmentId')
|
|
231
|
+
}) => name === 'enrollmentId')?.value;
|
|
234
232
|
return {
|
|
235
233
|
...relatesTo,
|
|
236
234
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Remediator.js","names":["Remediator","constructor","remediation","values","options","formatAuthenticators","authenticators","map","authenticator","formatAuthenticator","hasAuthenticatorInList","some","existing","compareAuthenticators","push","authenticatorsData","reduce","acc","Object","keys","length","getName","name","canRemediate","context","required","getRequiredValues","needed","find","key","hasData","getData","allValues","getAllValues","res","data","titleCase","val","value","entry","i","getNextStep","_authClient","_context","inputs","getInputs","getAuthenticator","type","inputsFromRemediation","forEach","inputFromRemediation","input","visible","messages","alias","aliases","includes","Array","isArray","getMessages","form","field","getValuesAfterProceed","inputsFromRemediator","relatesTo","authenticatorFromRemediation","getAuthenticatorFromRemediation","id","enrollmentId"],"sources":["../../../../../lib/idx/remediators/Base/Remediator.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\n/* eslint-disable complexity */\nimport { OktaAuthIdxInterface, NextStep, IdxMessage, Authenticator, Input, RemediateOptions } from '../../types';\nimport { IdxAuthenticator, IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { getAllValues, getRequiredValues, titleCase, getAuthenticatorFromRemediation } from '../util';\nimport { formatAuthenticator, compareAuthenticators } from '../../authenticator/util';\n\n// A map from IDX data values (server spec) to RemediationValues (client spec)\nexport type IdxToRemediationValueMap = Record<string, string[]>;\n\nexport interface RemediationValues {\n stateHandle?: string;\n authenticators?: (Authenticator | string)[];\n authenticator?: string | Authenticator;\n authenticatorsData?: Authenticator[];\n resend?: boolean;\n}\n\nexport interface RemediatorConstructor {\n new<T extends RemediationValues>(\n remediation: IdxRemediation, \n values?: T, \n options?: RemediateOptions\n ): any;\n}\n\n// Base class - DO NOT expose static remediationName\nexport class Remediator<T extends RemediationValues = RemediationValues> {\n static remediationName: string;\n\n remediation: IdxRemediation;\n values: T;\n options: RemediateOptions;\n map?: IdxToRemediationValueMap;\n\n constructor(\n remediation: IdxRemediation, \n values: T = {} as T, \n options: RemediateOptions = {}\n ) {\n // assign fields to the instance\n this.values = { ...values };\n this.options = { ...options };\n this.formatAuthenticators();\n this.remediation = remediation;\n }\n\n private formatAuthenticators() {\n this.values.authenticators = (this.values.authenticators || []) as Authenticator[];\n\n // ensure authenticators are in the correct format\n this.values.authenticators = this.values.authenticators.map(authenticator => {\n return formatAuthenticator(authenticator);\n });\n\n // add authenticator (if any) to \"authenticators\"\n if (this.values.authenticator) {\n const authenticator = formatAuthenticator(this.values.authenticator);\n const hasAuthenticatorInList = this.values.authenticators.some(existing => {\n return compareAuthenticators(authenticator, existing);\n });\n if (!hasAuthenticatorInList) {\n this.values.authenticators.push(authenticator);\n }\n }\n\n // save non-key meta to \"authenticatorsData\" field\n // authenticators will be removed after selection to avoid select-authenticator loop\n this.values.authenticatorsData = this.values.authenticators.reduce((acc, authenticator) => {\n if (typeof authenticator === 'object' && Object.keys(authenticator).length > 1) {\n // save authenticator meta into authenticator data\n acc.push(authenticator);\n }\n return acc;\n }, this.values.authenticatorsData || []);\n }\n\n getName(): string {\n return this.remediation.name;\n }\n\n // Override this method to provide custom check\n /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */\n canRemediate(context?: IdxContext): boolean {\n const required = getRequiredValues(this.remediation);\n const needed = required!.find((key) => !this.hasData(key));\n if (needed) {\n return false; // missing data for a required field\n }\n return true; // all required fields have available data\n }\n\n // returns an object for the entire remediation form, or just a part\n getData(key?: string) {\n if (!key) {\n let allValues = getAllValues(this.remediation);\n let res = allValues!.reduce((data, key) => {\n data[key] = this.getData(key); // recursive\n return data;\n }, {});\n return res;\n }\n\n // Map value by \"map${Property}\" function in each subClass\n if (typeof this[`map${titleCase(key)}`] === 'function') {\n const val = this[`map${titleCase(key)}`](\n this.remediation.value!.find(({name}) => name === key)\n );\n if (val) {\n return val;\n }\n }\n\n // If a map is defined for this key, return the first aliased property that returns a truthy value\n if (this.map && this.map[key]) {\n const entry = this.map[key];\n for (let i = 0; i < entry.length; i++) {\n let val = this.values[entry[i]];\n if (val) {\n return val;\n }\n }\n }\n\n // fallback: return the value by key\n return this.values[key];\n }\n\n hasData(\n key: string // idx name\n ): boolean \n {\n // no attempt to format, we want simple true/false\n return !!this.getData(key);\n }\n\n getNextStep(_authClient: OktaAuthIdxInterface, _context?: IdxContext): NextStep {\n const name = this.getName();\n const inputs = this.getInputs();\n const authenticator = this.getAuthenticator();\n // TODO: remove type field in the next major version change\n // https://oktainc.atlassian.net/browse/OKTA-431749\n const type = authenticator?.type;\n return { \n name, \n inputs, \n ...(type && { type }),\n ...(authenticator && { authenticator }),\n };\n }\n\n // Get inputs for the next step\n getInputs(): Input[] {\n const inputs: Input[] = [];\n const inputsFromRemediation = this.remediation.value || [];\n inputsFromRemediation.forEach(inputFromRemediation => {\n let input;\n let { name, type, visible, messages } = inputFromRemediation;\n if (visible === false) {\n return; // Filter out invisible inputs, like stateHandle\n }\n if (typeof this[`getInput${titleCase(name)}`] === 'function') {\n input = this[`getInput${titleCase(name)}`](inputFromRemediation);\n } else if (type !== 'object') {\n // handle general primitive types\n let alias;\n const aliases = (this.map ? this.map[name] : null) || [];\n if (aliases.length === 1) {\n alias = aliases[0];\n } else {\n // try find key from values\n alias = aliases.find(name => Object.keys(this.values).includes(name));\n }\n if (alias) {\n input = { ...inputFromRemediation, name: alias };\n }\n }\n if (!input) {\n input = inputFromRemediation;\n }\n if (Array.isArray(input)) {\n input.forEach(i => inputs.push(i));\n } else {\n // guarantees field-level messages are passed back\n if (messages) {\n input.messages = messages;\n }\n inputs.push(input);\n }\n });\n return inputs;\n }\n\n static getMessages(remediation: IdxRemediation): IdxMessage[] | undefined {\n if (!remediation.value) {\n return;\n }\n return remediation.value[0]?.form?.value.reduce((messages: IdxMessage[], field) => {\n if (field.messages) {\n messages = [...messages, ...field.messages.value];\n }\n return messages;\n }, []);\n }\n\n // Prepare values for the next remediation\n // In general, remove used values from inputs for the current remediation\n // Override this method if special cases need be handled\n getValuesAfterProceed(): T {\n const inputsFromRemediation = this.remediation.value || []; // \"raw\" inputs from server response\n const inputsFromRemediator = this.getInputs(); // \"aliased\" inputs from SDK remediator\n const inputs = [\n ...inputsFromRemediation,\n ...inputsFromRemediator\n ];\n // scrub all values related to this remediation\n for (const input of inputs) {\n delete this.values[input.name];\n }\n return this.values;\n }\n\n protected getAuthenticator(): IdxAuthenticator | undefined {\n // relatesTo value may be an authenticator or an authenticatorEnrollment\n const relatesTo = this.remediation.relatesTo?.value;\n if (!relatesTo) {\n return;\n }\n\n const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);\n if (!authenticatorFromRemediation) {\n // Hopefully value is an authenticator\n return relatesTo;\n }\n\n // If relatesTo is an authenticatorEnrollment, the id is actually the enrollmentId\n // Let's get the correct authenticator id from the form value\n const id = authenticatorFromRemediation.form!.value\n .find(({ name }) => name === 'id')!.value as string;\n const enrollmentId = authenticatorFromRemediation.form!.value\n .find(({ name }) => name === 'enrollmentId')?.value as string;\n\n return {\n ...relatesTo,\n id,\n enrollmentId\n };\n }\n}\n"],"mappings":";;;AAiBA;AACA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAyBA;AACO,MAAMA,UAAU,CAAkD;EAQvEC,WAAW,CACTC,WAA2B,EAC3BC,MAAS,GAAG,CAAC,CAAM,EACnBC,OAAyB,GAAG,CAAC,CAAC,EAC9B;IACA;IACA,IAAI,CAACD,MAAM,GAAG;MAAE,GAAGA;IAAO,CAAC;IAC3B,IAAI,CAACC,OAAO,GAAG;MAAE,GAAGA;IAAQ,CAAC;IAC7B,IAAI,CAACC,oBAAoB,EAAE;IAC3B,IAAI,CAACH,WAAW,GAAGA,WAAW;EAChC;EAEQG,oBAAoB,GAAG;IAC7B,IAAI,CAACF,MAAM,CAACG,cAAc,GAAI,IAAI,CAACH,MAAM,CAACG,cAAc,IAAI,EAAsB;;IAElF;IACA,IAAI,CAACH,MAAM,CAACG,cAAc,GAAG,IAAI,CAACH,MAAM,CAACG,cAAc,CAACC,GAAG,CAACC,aAAa,IAAI;MAC3E,OAAO,IAAAC,0BAAmB,EAACD,aAAa,CAAC;IAC3C,CAAC,CAAC;;IAEF;IACA,IAAI,IAAI,CAACL,MAAM,CAACK,aAAa,EAAE;MAC7B,MAAMA,aAAa,GAAG,IAAAC,0BAAmB,EAAC,IAAI,CAACN,MAAM,CAACK,aAAa,CAAC;MACpE,MAAME,sBAAsB,GAAG,IAAI,CAACP,MAAM,CAACG,cAAc,CAACK,IAAI,CAACC,QAAQ,IAAI;QACzE,OAAO,IAAAC,4BAAqB,EAACL,aAAa,EAAEI,QAAQ,CAAC;MACvD,CAAC,CAAC;MACF,IAAI,CAACF,sBAAsB,EAAE;QAC3B,IAAI,CAACP,MAAM,CAACG,cAAc,CAACQ,IAAI,CAACN,aAAa,CAAC;MAChD;IACF;;IAEA;IACA;IACA,IAAI,CAAC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ACpB;EAEU2C,gBAAgB,GAAiC;IAAA;IACzD;IACA,MAAMkB,SAAS,4BAAG,IAAI,CAAC9D,WAAW,CAAC8D,SAAS,0DAA1B,sBAA4B1B,KAAK;IACnD,IAAI,CAAC0B,SAAS,EAAE;MACd;IACF;IAEA,MAAMC,4BAA4B,GAAG,IAAAC,qCAA+B,EAAC,IAAI,CAAChE,WAAW,CAAC;IACtF,IAAI,CAAC+D,4BAA4B,EAAE;MACjC;MACA,OAAOD,SAAS;IAClB;;IAEA;IACA;IACA,MAAMG,EAAE,GAAGF,4BAA4B,CAACL,IAAI,CAAEtB,KAAK,CAChDV,IAAI,CAAC,CAAC;MAAEN;IAAK,CAAC,KAAKA,IAAI,KAAK,IAAI,CAAC,CAAEgB,KAAe;IACrD,MAAM8B,YAAY,kBAAGH,4BAA4B,CAACL,IAAI,CAAEtB,KAAK,CAC1DV,IAAI,CAAC,CAAC;MAAEN;IAAK,CAAC,KAAKA,IAAI,KAAK,cAAc,CAAC,gDADzB,YAC2BgB,KAAe;IAE/D,OAAO;MACL,GAAG0B,SAAS;MACZG,EAAE;MACFC;IACF,CAAC;EACH;AACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"Remediator.js","names":["Remediator","constructor","remediation","values","options","formatAuthenticators","authenticators","map","authenticator","formatAuthenticator","hasAuthenticatorInList","some","existing","compareAuthenticators","push","authenticatorsData","reduce","acc","Object","keys","length","getName","name","canRemediate","context","required","getRequiredValues","needed","find","key","hasData","getData","allValues","getAllValues","res","data","titleCase","val","value","entry","i","getNextStep","_authClient","_context","inputs","getInputs","getAuthenticator","type","inputsFromRemediation","forEach","inputFromRemediation","input","visible","messages","alias","aliases","includes","Array","isArray","getMessages","form","field","getValuesAfterProceed","inputsFromRemediator","relatesTo","authenticatorFromRemediation","getAuthenticatorFromRemediation","id","enrollmentId"],"sources":["../../../../../lib/idx/remediators/Base/Remediator.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\n/* eslint-disable complexity */\nimport { OktaAuthIdxInterface, NextStep, IdxMessage, Authenticator, Input, RemediateOptions } from '../../types';\nimport { IdxAuthenticator, IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { getAllValues, getRequiredValues, titleCase, getAuthenticatorFromRemediation } from '../util';\nimport { formatAuthenticator, compareAuthenticators } from '../../authenticator/util';\n\n// A map from IDX data values (server spec) to RemediationValues (client spec)\nexport type IdxToRemediationValueMap = Record<string, string[]>;\n\nexport interface RemediationValues {\n stateHandle?: string;\n authenticators?: (Authenticator | string)[];\n authenticator?: string | Authenticator;\n authenticatorsData?: Authenticator[];\n resend?: boolean;\n}\n\nexport interface RemediatorConstructor {\n remediationName: string;\n new<T extends RemediationValues>(\n remediation: IdxRemediation, \n values?: T, \n options?: RemediateOptions\n ): any;\n}\n\n// Base class - DO NOT expose static remediationName\nexport class Remediator<T extends RemediationValues = RemediationValues> {\n static remediationName: string;\n\n remediation: IdxRemediation;\n values: T;\n options: RemediateOptions;\n map?: IdxToRemediationValueMap;\n\n constructor(\n remediation: IdxRemediation, \n values: T = {} as T, \n options: RemediateOptions = {}\n ) {\n // assign fields to the instance\n this.values = { ...values };\n this.options = { ...options };\n this.formatAuthenticators();\n this.remediation = remediation;\n }\n\n private formatAuthenticators() {\n this.values.authenticators = (this.values.authenticators || []) as Authenticator[];\n\n // ensure authenticators are in the correct format\n this.values.authenticators = this.values.authenticators.map(authenticator => {\n return formatAuthenticator(authenticator);\n });\n\n // add authenticator (if any) to \"authenticators\"\n if (this.values.authenticator) {\n const authenticator = formatAuthenticator(this.values.authenticator);\n const hasAuthenticatorInList = this.values.authenticators.some(existing => {\n return compareAuthenticators(authenticator, existing);\n });\n if (!hasAuthenticatorInList) {\n this.values.authenticators.push(authenticator);\n }\n }\n\n // save non-key meta to \"authenticatorsData\" field\n // authenticators will be removed after selection to avoid select-authenticator loop\n this.values.authenticatorsData = this.values.authenticators.reduce((acc, authenticator) => {\n if (typeof authenticator === 'object' && Object.keys(authenticator).length > 1) {\n // save authenticator meta into authenticator data\n acc.push(authenticator);\n }\n return acc;\n }, this.values.authenticatorsData || []);\n }\n\n getName(): string {\n return this.remediation.name;\n }\n\n // Override this method to provide custom check\n /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */\n canRemediate(context?: IdxContext): boolean {\n const required = getRequiredValues(this.remediation);\n const needed = required!.find((key) => !this.hasData(key));\n if (needed) {\n return false; // missing data for a required field\n }\n return true; // all required fields have available data\n }\n\n // returns an object for the entire remediation form, or just a part\n getData(key?: string) {\n if (!key) {\n let allValues = getAllValues(this.remediation);\n let res = allValues!.reduce((data, key) => {\n data[key] = this.getData(key); // recursive\n return data;\n }, {});\n return res;\n }\n\n // Map value by \"map${Property}\" function in each subClass\n if (typeof this[`map${titleCase(key)}`] === 'function') {\n const val = this[`map${titleCase(key)}`](\n this.remediation.value!.find(({name}) => name === key)\n );\n if (val) {\n return val;\n }\n }\n\n // If a map is defined for this key, return the first aliased property that returns a truthy value\n if (this.map && this.map[key]) {\n const entry = this.map[key];\n for (let i = 0; i < entry.length; i++) {\n let val = this.values[entry[i]];\n if (val) {\n return val;\n }\n }\n }\n\n // fallback: return the value by key\n return this.values[key];\n }\n\n hasData(\n key: string // idx name\n ): boolean \n {\n // no attempt to format, we want simple true/false\n return !!this.getData(key);\n }\n\n getNextStep(_authClient: OktaAuthIdxInterface, _context?: IdxContext): NextStep {\n const name = this.getName();\n const inputs = this.getInputs();\n const authenticator = this.getAuthenticator();\n // TODO: remove type field in the next major version change\n // https://oktainc.atlassian.net/browse/OKTA-431749\n const type = authenticator?.type;\n return { \n name, \n inputs, \n ...(type && { type }),\n ...(authenticator && { authenticator }),\n };\n }\n\n // Get inputs for the next step\n getInputs(): Input[] {\n const inputs: Input[] = [];\n const inputsFromRemediation = this.remediation.value || [];\n inputsFromRemediation.forEach(inputFromRemediation => {\n let input;\n let { name, type, visible, messages } = inputFromRemediation;\n if (visible === false) {\n return; // Filter out invisible inputs, like stateHandle\n }\n if (typeof this[`getInput${titleCase(name)}`] === 'function') {\n input = this[`getInput${titleCase(name)}`](inputFromRemediation);\n } else if (type !== 'object') {\n // handle general primitive types\n let alias;\n const aliases = (this.map ? this.map[name] : null) || [];\n if (aliases.length === 1) {\n alias = aliases[0];\n } else {\n // try find key from values\n alias = aliases.find(name => Object.keys(this.values).includes(name));\n }\n if (alias) {\n input = { ...inputFromRemediation, name: alias };\n }\n }\n if (!input) {\n input = inputFromRemediation;\n }\n if (Array.isArray(input)) {\n input.forEach(i => inputs.push(i));\n } else {\n // guarantees field-level messages are passed back\n if (messages) {\n input.messages = messages;\n }\n inputs.push(input);\n }\n });\n return inputs;\n }\n\n static getMessages(remediation: IdxRemediation): IdxMessage[] | undefined {\n if (!remediation.value) {\n return;\n }\n return remediation.value[0]?.form?.value.reduce((messages: IdxMessage[], field) => {\n if (field.messages) {\n messages = [...messages, ...field.messages.value];\n }\n return messages;\n }, []);\n }\n\n // Prepare values for the next remediation\n // In general, remove used values from inputs for the current remediation\n // Override this method if special cases need be handled\n getValuesAfterProceed(): T {\n const inputsFromRemediation = this.remediation.value || []; // \"raw\" inputs from server response\n const inputsFromRemediator = this.getInputs(); // \"aliased\" inputs from SDK remediator\n const inputs = [\n ...inputsFromRemediation,\n ...inputsFromRemediator\n ];\n // scrub all values related to this remediation\n for (const input of inputs) {\n delete this.values[input.name];\n }\n return this.values;\n }\n\n protected getAuthenticator(): IdxAuthenticator | undefined {\n // relatesTo value may be an authenticator or an authenticatorEnrollment\n const relatesTo = this.remediation.relatesTo?.value;\n if (!relatesTo) {\n return;\n }\n\n const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);\n if (!authenticatorFromRemediation) {\n // Hopefully value is an authenticator\n return relatesTo;\n }\n\n // If relatesTo is an authenticatorEnrollment, the id is actually the enrollmentId\n // Let's get the correct authenticator id from the form value\n const id = authenticatorFromRemediation.form!.value\n .find(({ name }) => name === 'id')!.value as string;\n const enrollmentId = authenticatorFromRemediation.form!.value\n .find(({ name }) => name === 'enrollmentId')?.value as string;\n\n return {\n ...relatesTo,\n id,\n enrollmentId\n };\n }\n}\n"],"mappings":";;;AAiBA;AACA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AA0BA;AACO,MAAMA,UAAU,CAAkD;EAQvEC,WAAW,CACTC,WAA2B,EAC3BC,MAAS,GAAG,CAAC,CAAM,EACnBC,OAAyB,GAAG,CAAC,CAAC,EAC9B;IACA;IACA,IAAI,CAACD,MAAM,GAAG;MAAE,GAAGA;IAAO,CAAC;IAC3B,IAAI,CAACC,OAAO,GAAG;MAAE,GAAGA;IAAQ,CAAC;IAC7B,IAAI,CAACC,oBAAoB,EAAE;IAC3B,IAAI,CAACH,WAAW,GAAGA,WAAW;EAChC;EAEQG,oBAAoB,GAAG;IAC7B,IAAI,CAACF,MAAM,CAACG,cAAc,GAAI,IAAI,CAACH,MAAM,CAACG,cAAc,IAAI,EAAsB;;IAElF;IACA,IAAI,CAACH,MAAM,CAACG,cAAc,GAAG,IAAI,CAACH,MAAM,CAACG,cAAc,CAACC,GAAG,CAACC,aAAa,IAAI;MAC3E,OAAO,IAAAC,0BAAmB,EAACD,aAAa,CAAC;IAC3C,CAAC,CAAC;;IAEF;IACA,IAAI,IAAI,CAACL,MAAM,CAACK,aAAa,EAAE;MAC7B,MAAMA,aAAa,GAAG,IAAAC,0BAAmB,EAAC,IAAI,CAACN,MAAM,CAACK,aAAa,CAAC;MACpE,MAAME,sBAAsB,GA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C/C,MAAMD,MAAM,GAAG,CACb,GAAGI,qBAAqB,EACxB,GAAGe,oBAAoB,CACxB;IACD;IACA,KAAK,MAAMZ,KAAK,IAAIP,MAAM,EAAE;MAC1B,OAAO,IAAI,CAACzC,MAAM,CAACgD,KAAK,CAAC7B,IAAI,CAAC;IAChC;IACA,OAAO,IAAI,CAACnB,MAAM;EACpB;EAEU2C,gBAAgB,GAAiC;IACzD;IACA,MAAMkB,SAAS,GAAG,IAAI,CAAC9D,WAAW,CAAC8D,SAAS,EAAE1B,KAAK;IACnD,IAAI,CAAC0B,SAAS,EAAE;MACd;IACF;IAEA,MAAMC,4BAA4B,GAAG,IAAAC,qCAA+B,EAAC,IAAI,CAAChE,WAAW,CAAC;IACtF,IAAI,CAAC+D,4BAA4B,EAAE;MACjC;MACA,OAAOD,SAAS;IAClB;;IAEA;IACA;IACA,MAAMG,EAAE,GAAGF,4BAA4B,CAACL,IAAI,CAAEtB,KAAK,CAChDV,IAAI,CAAC,CAAC;MAAEN;IAAK,CAAC,KAAKA,IAAI,KAAK,IAAI,CAAC,CAAEgB,KAAe;IACrD,MAAM8B,YAAY,GAAGH,4BAA4B,CAACL,IAAI,CAAEtB,KAAK,CAC1DV,IAAI,CAAC,CAAC;MAAEN;IAAK,CAAC,KAAKA,IAAI,KAAK,cAAc,CAAC,EAAEgB,KAAe;IAE/D,OAAO;MACL,GAAG0B,SAAS;MACZG,EAAE;MACFC;IACF,CAAC;EACH;AACF;AAAC"}
|
|
@@ -57,10 +57,9 @@ class SelectAuthenticator extends _Remediator.Remediator {
|
|
|
57
57
|
// Proceed with provided authenticators
|
|
58
58
|
const matchedOption = this.findMatchedOption(authenticators, options);
|
|
59
59
|
if (matchedOption) {
|
|
60
|
-
var _matchedOption$relate, _matchedOption$relate2;
|
|
61
60
|
// Don't select current authenticator (OKTA-612939)
|
|
62
|
-
const isCurrentAuthenticator =
|
|
63
|
-
const isCurrentAuthenticatorEnrollment =
|
|
61
|
+
const isCurrentAuthenticator = context?.currentAuthenticator && context?.currentAuthenticator.value.id === matchedOption.relatesTo?.id;
|
|
62
|
+
const isCurrentAuthenticatorEnrollment = context?.currentAuthenticatorEnrollment && context?.currentAuthenticatorEnrollment.value.id === matchedOption.relatesTo?.id;
|
|
64
63
|
return !isCurrentAuthenticator && !isCurrentAuthenticatorEnrollment;
|
|
65
64
|
}
|
|
66
65
|
return false;
|
|
@@ -83,7 +82,7 @@ class SelectAuthenticator extends _Remediator.Remediator {
|
|
|
83
82
|
this.selectedAuthenticator = selectedOption.relatesTo; // track the selected authenticator
|
|
84
83
|
this.selectedOption = selectedOption;
|
|
85
84
|
return {
|
|
86
|
-
id: selectedOption
|
|
85
|
+
id: selectedOption?.value.form.value.find(({
|
|
87
86
|
name
|
|
88
87
|
}) => name === 'id').value
|
|
89
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectAuthenticator.js","names":["SelectAuthenticator","Remediator","findMatchedOption","authenticators","options","option","authenticator","find","relatesTo","key","canRemediate","context","values","authenticatorFromRemediation","getAuthenticatorFromRemediation","remediation","length","isAuthenticator","id","matchedOption","isCurrentAuthenticator","currentAuthenticator","value","isCurrentAuthenticatorEnrollment","currentAuthenticatorEnrollment","mapAuthenticator","remediationValue","selectedAuthenticator","selectedOption","form","name","getInputAuthenticator","map","label","type","getValuesAfterProceed","filter","compareAuthenticators"],"sources":["../../../../../lib/idx/remediators/Base/SelectAuthenticator.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticatorFromRemediation } from '../util';\nimport { IdxRemediationValue, IdxContext, IdxOption } from '../../types/idx-js';\nimport { Authenticator, isAuthenticator } from '../../types/api';\nimport { compareAuthenticators, findMatchedOption} from '../../authenticator/util';\n\nexport type SelectAuthenticatorValues = RemediationValues & {\n authenticator?: string | Authenticator;\n};\n\n// Base class - DO NOT expose static remediationName\nexport class SelectAuthenticator<T extends SelectAuthenticatorValues = SelectAuthenticatorValues>\n extends Remediator<T> {\n selectedAuthenticator?: Authenticator;\n selectedOption?: any;\n\n // Find matched authenticator in provided order\n findMatchedOption(authenticators, options) {\n let option: IdxOption | undefined;\n for (let authenticator of authenticators) {\n option = options\n .find(({ relatesTo }) => relatesTo.key && relatesTo.key === authenticator.key);\n if (option) {\n break;\n }\n }\n return option;\n }\n\n /* eslint complexity:[0,9] */\n canRemediate(context?: IdxContext) {\n const { authenticators, authenticator } = this.values;\n const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);\n const { options } = authenticatorFromRemediation;\n // Let users select authenticator if no input is provided\n if (!authenticators || !authenticators.length) {\n return false;\n }\n\n // Authenticator is explicitly specified by id\n if (isAuthenticator(authenticator) && authenticator.id) {\n return true;\n }\n\n // Proceed with provided authenticators\n const matchedOption = this.findMatchedOption(authenticators, options!);\n if (matchedOption) {\n // Don't select current authenticator (OKTA-612939)\n const isCurrentAuthenticator = context?.currentAuthenticator\n && context?.currentAuthenticator.value.id === matchedOption.relatesTo?.id;\n const isCurrentAuthenticatorEnrollment = context?.currentAuthenticatorEnrollment\n && context?.currentAuthenticatorEnrollment.value.id === matchedOption.relatesTo?.id;\n return !isCurrentAuthenticator && !isCurrentAuthenticatorEnrollment;\n }\n \n return false;\n }\n\n mapAuthenticator(remediationValue: IdxRemediationValue) {\n const { authenticators, authenticator } = this.values;\n\n // Authenticator is explicitly specified by id\n if (isAuthenticator(authenticator) && authenticator.id) {\n this.selectedAuthenticator = authenticator; // track the selected authenticator\n return authenticator;\n }\n\n const { options } = remediationValue;\n const selectedOption = findMatchedOption(authenticators, options);\n this.selectedAuthenticator = selectedOption.relatesTo; // track the selected authenticator\n this.selectedOption = selectedOption;\n return {\n id: selectedOption?.value.form.value.find(({ name }) => name === 'id').value\n };\n }\n\n getInputAuthenticator(remediation) {\n const options = remediation.options.map(({ label, relatesTo }) => {\n return {\n label,\n value: relatesTo.key\n };\n });\n return { name: 'authenticator', type: 'string', options };\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n // remove used authenticators\n const authenticators = (this.values.authenticators as Authenticator[])\n .filter(authenticator => {\n return compareAuthenticators(authenticator, this.selectedAuthenticator) !== true;\n });\n return { ...this.values, authenticators };\n }\n\n}\n"],"mappings":";;;AAcA;AACA;AAEA;AACA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACO,MAAMA,mBAAmB,SACtBC,sBAAU,CAAI;EAItB;EACAC,iBAAiB,CAACC,cAAc,EAAEC,OAAO,EAAE;IACzC,IAAIC,MAA6B;IACjC,KAAK,IAAIC,aAAa,IAAIH,cAAc,EAAE;MACxCE,MAAM,GAAGD,OAAO,CACbG,IAAI,CAAC,CAAC;QAAEC;MAAU,CAAC,KAAKA,SAAS,CAACC,GAAG,IAAID,SAAS,CAACC,GAAG,KAAKH,aAAa,CAACG,GAAG,CAAC;MAChF,IAAIJ,MAAM,EAAE;QACV;MACF;IACF;IACA,OAAOA,MAAM;EACf;;EAEA;EACAK,YAAY,CAACC,OAAoB,EAAE;IACjC,MAAM;MAAER,cAAc;MAAEG;IAAc,CAAC,GAAG,IAAI,CAACM,MAAM;IACrD,MAAMC,4BAA4B,GAAG,IAAAC,qCAA+B,EAAC,IAAI,CAACC,WAAW,CAAC;IACtF,MAAM;MAAEX;IAAQ,CAAC,GAAGS,4BAA4B;IAChD;IACA,IAAI,CAACV,cAAc,IAAI,CAACA,cAAc,CAACa,MAAM,EAAE;MAC7C,OAAO,KAAK;IACd;;IAEA;IACA,IAAI,IAAAC,oBAAe,EAACX,aAAa,CAAC,IAAIA,aAAa,CAACY,EAAE,EAAE;MACtD,OAAO,IAAI;IACb;;IAEA;IACA,MAAMC,aAAa,GAAG,IAAI,CAACjB,iBAAiB,CAACC,cAAc,EAAEC,OAAO,CAAE;IACtE,IAAIe,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"SelectAuthenticator.js","names":["SelectAuthenticator","Remediator","findMatchedOption","authenticators","options","option","authenticator","find","relatesTo","key","canRemediate","context","values","authenticatorFromRemediation","getAuthenticatorFromRemediation","remediation","length","isAuthenticator","id","matchedOption","isCurrentAuthenticator","currentAuthenticator","value","isCurrentAuthenticatorEnrollment","currentAuthenticatorEnrollment","mapAuthenticator","remediationValue","selectedAuthenticator","selectedOption","form","name","getInputAuthenticator","map","label","type","getValuesAfterProceed","filter","compareAuthenticators"],"sources":["../../../../../lib/idx/remediators/Base/SelectAuthenticator.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticatorFromRemediation } from '../util';\nimport { IdxRemediationValue, IdxContext, IdxOption } from '../../types/idx-js';\nimport { Authenticator, isAuthenticator } from '../../types/api';\nimport { compareAuthenticators, findMatchedOption} from '../../authenticator/util';\n\nexport type SelectAuthenticatorValues = RemediationValues & {\n authenticator?: string | Authenticator;\n};\n\n// Base class - DO NOT expose static remediationName\nexport class SelectAuthenticator<T extends SelectAuthenticatorValues = SelectAuthenticatorValues>\n extends Remediator<T> {\n selectedAuthenticator?: Authenticator;\n selectedOption?: any;\n\n // Find matched authenticator in provided order\n findMatchedOption(authenticators, options) {\n let option: IdxOption | undefined;\n for (let authenticator of authenticators) {\n option = options\n .find(({ relatesTo }) => relatesTo.key && relatesTo.key === authenticator.key);\n if (option) {\n break;\n }\n }\n return option;\n }\n\n /* eslint complexity:[0,9] */\n canRemediate(context?: IdxContext) {\n const { authenticators, authenticator } = this.values;\n const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);\n const { options } = authenticatorFromRemediation;\n // Let users select authenticator if no input is provided\n if (!authenticators || !authenticators.length) {\n return false;\n }\n\n // Authenticator is explicitly specified by id\n if (isAuthenticator(authenticator) && authenticator.id) {\n return true;\n }\n\n // Proceed with provided authenticators\n const matchedOption = this.findMatchedOption(authenticators, options!);\n if (matchedOption) {\n // Don't select current authenticator (OKTA-612939)\n const isCurrentAuthenticator = context?.currentAuthenticator\n && context?.currentAuthenticator.value.id === matchedOption.relatesTo?.id;\n const isCurrentAuthenticatorEnrollment = context?.currentAuthenticatorEnrollment\n && context?.currentAuthenticatorEnrollment.value.id === matchedOption.relatesTo?.id;\n return !isCurrentAuthenticator && !isCurrentAuthenticatorEnrollment;\n }\n \n return false;\n }\n\n mapAuthenticator(remediationValue: IdxRemediationValue) {\n const { authenticators, authenticator } = this.values;\n\n // Authenticator is explicitly specified by id\n if (isAuthenticator(authenticator) && authenticator.id) {\n this.selectedAuthenticator = authenticator; // track the selected authenticator\n return authenticator;\n }\n\n const { options } = remediationValue;\n const selectedOption = findMatchedOption(authenticators, options);\n this.selectedAuthenticator = selectedOption.relatesTo; // track the selected authenticator\n this.selectedOption = selectedOption;\n return {\n id: selectedOption?.value.form.value.find(({ name }) => name === 'id').value\n };\n }\n\n getInputAuthenticator(remediation) {\n const options = remediation.options.map(({ label, relatesTo }) => {\n return {\n label,\n value: relatesTo.key\n };\n });\n return { name: 'authenticator', type: 'string', options };\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n // remove used authenticators\n const authenticators = (this.values.authenticators as Authenticator[])\n .filter(authenticator => {\n return compareAuthenticators(authenticator, this.selectedAuthenticator) !== true;\n });\n return { ...this.values, authenticators };\n }\n\n}\n"],"mappings":";;;AAcA;AACA;AAEA;AACA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACO,MAAMA,mBAAmB,SACtBC,sBAAU,CAAI;EAItB;EACAC,iBAAiB,CAACC,cAAc,EAAEC,OAAO,EAAE;IACzC,IAAIC,MAA6B;IACjC,KAAK,IAAIC,aAAa,IAAIH,cAAc,EAAE;MACxCE,MAAM,GAAGD,OAAO,CACbG,IAAI,CAAC,CAAC;QAAEC;MAAU,CAAC,KAAKA,SAAS,CAACC,GAAG,IAAID,SAAS,CAACC,GAAG,KAAKH,aAAa,CAACG,GAAG,CAAC;MAChF,IAAIJ,MAAM,EAAE;QACV;MACF;IACF;IACA,OAAOA,MAAM;EACf;;EAEA;EACAK,YAAY,CAACC,OAAoB,EAAE;IACjC,MAAM;MAAER,cAAc;MAAEG;IAAc,CAAC,GAAG,IAAI,CAACM,MAAM;IACrD,MAAMC,4BAA4B,GAAG,IAAAC,qCAA+B,EAAC,IAAI,CAACC,WAAW,CAAC;IACtF,MAAM;MAAEX;IAAQ,CAAC,GAAGS,4BAA4B;IAChD;IACA,IAAI,CAACV,cAAc,IAAI,CAACA,cAAc,CAACa,MAAM,EAAE;MAC7C,OAAO,KAAK;IACd;;IAEA;IACA,IAAI,IAAAC,oBAAe,EAACX,aAAa,CAAC,IAAIA,aAAa,CAACY,EAAE,EAAE;MACtD,OAAO,IAAI;IACb;;IAEA;IACA,MAAMC,aAAa,GAAG,IAAI,CAACjB,iBAAiB,CAACC,cAAc,EAAEC,OAAO,CAAE;IACtE,IAAIe,aAAa,EAAE;MACjB;MACA,MAAMC,sBAAsB,GA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C,CAAC;IACF,OAAO;MAAEqB,IAAI,EAAE,eAAe;MAAEI,IAAI,EAAE,QAAQ;MAAE9B;IAAQ,CAAC;EAC3D;EAEA+B,qBAAqB,GAAM;IACzB,IAAI,CAACvB,MAAM,GAAG,KAAK,CAACuB,qBAAqB,EAAE;IAC3C;IACA,MAAMhC,cAAc,GAAI,IAAI,CAACS,MAAM,CAACT,cAAc,CAC/CiC,MAAM,CAAC9B,aAAa,IAAI;MACvB,OAAO,IAAA+B,4BAAqB,EAAC/B,aAAa,EAAE,IAAI,CAACqB,qBAAqB,CAAC,KAAK,IAAI;IAClF,CAAC,CAAC;IACJ,OAAO;MAAE,GAAG,IAAI,CAACf,MAAM;MAAET;IAAe,CAAC;EAC3C;AAEF;AAAC"}
|
|
@@ -22,9 +22,8 @@ class VerifyAuthenticator extends _Remediator.Remediator {
|
|
|
22
22
|
this.authenticator = (0, _authenticator.getAuthenticator)(remediation);
|
|
23
23
|
}
|
|
24
24
|
getNextStep(authClient, context) {
|
|
25
|
-
var _context$authenticato;
|
|
26
25
|
const nextStep = super.getNextStep(authClient, context);
|
|
27
|
-
const authenticatorEnrollments = context
|
|
26
|
+
const authenticatorEnrollments = context?.authenticatorEnrollments?.value;
|
|
28
27
|
return {
|
|
29
28
|
...nextStep,
|
|
30
29
|
authenticatorEnrollments
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyAuthenticator.js","names":["VerifyAuthenticator","Remediator","constructor","remediation","values","authenticator","getAuthenticator","getNextStep","authClient","context","nextStep","authenticatorEnrollments","value","canRemediate","canVerify","mapCredentials","getInputCredentials","input","getInputs","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../../lib/idx/remediators/Base/VerifyAuthenticator.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticator, Authenticator, AuthenticatorValues } from '../../authenticator';\nimport { IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { OktaAuthIdxInterface, NextStep } from '../../types';\n\nexport type VerifyAuthenticatorValues = AuthenticatorValues & RemediationValues;\n\n// Base class - DO NOT expose static remediationName\nexport class VerifyAuthenticator<T extends VerifyAuthenticatorValues = VerifyAuthenticatorValues>\n extends Remediator<T> {\n\n authenticator: Authenticator<VerifyAuthenticatorValues>;\n\n constructor(remediation: IdxRemediation, values: T = {} as T) {\n super(remediation, values);\n this.authenticator = getAuthenticator(remediation);\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const nextStep = super.getNextStep(authClient, context);\n const authenticatorEnrollments = context?.authenticatorEnrollments?.value;\n\n return {\n ...nextStep,\n authenticatorEnrollments\n };\n }\n\n canRemediate() {\n return this.authenticator.canVerify(this.values);\n }\n\n mapCredentials() {\n return this.authenticator.mapCredentials(this.values);\n }\n\n getInputCredentials(input) {\n return this.authenticator.getInputs(input);\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'credentials');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {} as T);\n }\n}\n"],"mappings":";;;AAaA;AACA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACO,MAAMA,mBAAmB,SACtBC,sBAAU,CAAI;EAItBC,WAAW,CAACC,WAA2B,EAAEC,MAAS,GAAG,CAAC,CAAM,EAAE;IAC5D,KAAK,CAACD,WAAW,EAAEC,MAAM,CAAC;IAC1B,IAAI,CAACC,aAAa,GAAG,IAAAC,+BAAgB,EAACH,WAAW,CAAC;EACpD;EAEAI,WAAW,CAACC,UAAgC,EAAEC,OAAoB,EAAY;
|
|
1
|
+
{"version":3,"file":"VerifyAuthenticator.js","names":["VerifyAuthenticator","Remediator","constructor","remediation","values","authenticator","getAuthenticator","getNextStep","authClient","context","nextStep","authenticatorEnrollments","value","canRemediate","canVerify","mapCredentials","getInputCredentials","input","getInputs","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../../lib/idx/remediators/Base/VerifyAuthenticator.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticator, Authenticator, AuthenticatorValues } from '../../authenticator';\nimport { IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { OktaAuthIdxInterface, NextStep } from '../../types';\n\nexport type VerifyAuthenticatorValues = AuthenticatorValues & RemediationValues;\n\n// Base class - DO NOT expose static remediationName\nexport class VerifyAuthenticator<T extends VerifyAuthenticatorValues = VerifyAuthenticatorValues>\n extends Remediator<T> {\n\n authenticator: Authenticator<VerifyAuthenticatorValues>;\n\n constructor(remediation: IdxRemediation, values: T = {} as T) {\n super(remediation, values);\n this.authenticator = getAuthenticator(remediation);\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const nextStep = super.getNextStep(authClient, context);\n const authenticatorEnrollments = context?.authenticatorEnrollments?.value;\n\n return {\n ...nextStep,\n authenticatorEnrollments\n };\n }\n\n canRemediate() {\n return this.authenticator.canVerify(this.values);\n }\n\n mapCredentials() {\n return this.authenticator.mapCredentials(this.values);\n }\n\n getInputCredentials(input) {\n return this.authenticator.getInputs(input);\n }\n\n getValuesAfterProceed(): T {\n this.values = super.getValuesAfterProceed();\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'credentials');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {} as T);\n }\n}\n"],"mappings":";;;AAaA;AACA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACO,MAAMA,mBAAmB,SACtBC,sBAAU,CAAI;EAItBC,WAAW,CAACC,WAA2B,EAAEC,MAAS,GAAG,CAAC,CAAM,EAAE;IAC5D,KAAK,CAACD,WAAW,EAAEC,MAAM,CAAC;IAC1B,IAAI,CAACC,aAAa,GAAG,IAAAC,+BAAgB,EAACH,WAAW,CAAC;EACpD;EAEAI,WAAW,CAACC,UAAgC,EAAEC,OAAoB,EAAY;IAC5E,MAAMC,QAAQ,GAAG,KAAK,CAACH,WAAW,CAACC,UAAU,EAAEC,OAAO,CAAC;IACvD,MAAME,wBAAwB,GAAGF,OAAO,EAAEE,wBAAwB,EAAEC,KAAK;IAEzE,OAAO;MACL,GAAGF,QAAQ;MACXC;IACF,CAAC;EACH;EAEAE,YAAY,GAAG;IACb,OAAO,IAAI,CAACR,aAAa,CAACS,SAAS,CAAC,IAAI,CAACV,MAAM,CAAC;EAClD;EAEAW,cAAc,GAAG;IACf,OAAO,IAAI,CAACV,aAAa,CAACU,cAAc,CAAC,IAAI,CAACX,MAAM,CAAC;EACvD;EAEAY,mBAAmB,CAACC,KAAK,EAAE;IACzB,OAAO,IAAI,CAACZ,aAAa,CAACa,SAAS,CAACD,KAAK,CAAC;EAC5C;EAEAE,qBAAqB,GAAM;IACzB,IAAI,CAACf,MAAM,GAAG,KAAK,CAACe,qBAAqB,EAAE;IAC3C,IAAIC,aAAa,GAAGC,MAAM,CAACC,IAAI,CAAC,IAAI,CAAClB,MAAM,CAAC,CAACmB,MAAM,CAACC,QAAQ,IAAIA,QAAQ,KAAK,aAAa,CAAC;IAC3F,OAAOJ,aAAa,CAACK,MAAM,CAAC,CAACrB,MAAM,EAAEoB,QAAQ,MAAM;MAAC,GAAGpB,MAAM;MAAE,CAACoB,QAAQ,GAAG,IAAI,CAACpB,MAAM,CAACoB,QAAQ;IAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAM;EAC9G;AACF;AAAC"}
|
|
@@ -23,7 +23,7 @@ class EnrollPoll extends _Remediator.Remediator {
|
|
|
23
23
|
getNextStep(authClient, context) {
|
|
24
24
|
const common = super.getNextStep(authClient, context);
|
|
25
25
|
let authenticator = this.getAuthenticator();
|
|
26
|
-
if (!authenticator && context
|
|
26
|
+
if (!authenticator && context?.currentAuthenticator) {
|
|
27
27
|
authenticator = context.currentAuthenticator.value;
|
|
28
28
|
}
|
|
29
29
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnrollPoll.js","names":["EnrollPoll","Remediator","canRemediate","values","startPolling","options","step","getNextStep","authClient","context","common","authenticator","getAuthenticator","currentAuthenticator","value","poll","required","refresh","remediation","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../lib/idx/remediators/EnrollPoll.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { NextStep, OktaAuthIdxInterface } from '../types';\nimport { IdxContext } from '../types/idx-js';\n\nexport interface EnrollPollValues extends RemediationValues {\n startPolling?: boolean;\n}\n\nexport class EnrollPoll extends Remediator<EnrollPollValues> {\n static remediationName = 'enroll-poll';\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'enroll-poll';\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const common = super.getNextStep(authClient, context);\n let authenticator = this.getAuthenticator();\n if (!authenticator && context?.currentAuthenticator) {\n authenticator = context.currentAuthenticator.value;\n }\n return {\n ...common,\n authenticator,\n poll: {\n required: true,\n refresh: this.remediation.refresh\n },\n };\n }\n\n getValuesAfterProceed(): EnrollPollValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWO,MAAMA,UAAU,SAASC,sBAAU,CAAmB;EAG3DC,YAAY,GAAG;IACb,OAAO,CAAC,CAAC,IAAI,CAACC,MAAM,CAACC,YAAY,IAAI,IAAI,CAACC,OAAO,CAACC,IAAI,KAAK,aAAa;EAC1E;EAEAC,WAAW,CAACC,UAAgC,EAAEC,OAAoB,EAAY;IAC5E,MAAMC,MAAM,GAAG,KAAK,CAACH,WAAW,CAACC,UAAU,EAAEC,OAAO,CAAC;IACrD,IAAIE,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;IAC3C,IAAI,CAACD,aAAa,IAAIF,OAAO,
|
|
1
|
+
{"version":3,"file":"EnrollPoll.js","names":["EnrollPoll","Remediator","canRemediate","values","startPolling","options","step","getNextStep","authClient","context","common","authenticator","getAuthenticator","currentAuthenticator","value","poll","required","refresh","remediation","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../lib/idx/remediators/EnrollPoll.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { NextStep, OktaAuthIdxInterface } from '../types';\nimport { IdxContext } from '../types/idx-js';\n\nexport interface EnrollPollValues extends RemediationValues {\n startPolling?: boolean;\n}\n\nexport class EnrollPoll extends Remediator<EnrollPollValues> {\n static remediationName = 'enroll-poll';\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'enroll-poll';\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context?: IdxContext): NextStep {\n const common = super.getNextStep(authClient, context);\n let authenticator = this.getAuthenticator();\n if (!authenticator && context?.currentAuthenticator) {\n authenticator = context.currentAuthenticator.value;\n }\n return {\n ...common,\n authenticator,\n poll: {\n required: true,\n refresh: this.remediation.refresh\n },\n };\n }\n\n getValuesAfterProceed(): EnrollPollValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWO,MAAMA,UAAU,SAASC,sBAAU,CAAmB;EAG3DC,YAAY,GAAG;IACb,OAAO,CAAC,CAAC,IAAI,CAACC,MAAM,CAACC,YAAY,IAAI,IAAI,CAACC,OAAO,CAACC,IAAI,KAAK,aAAa;EAC1E;EAEAC,WAAW,CAACC,UAAgC,EAAEC,OAAoB,EAAY;IAC5E,MAAMC,MAAM,GAAG,KAAK,CAACH,WAAW,CAACC,UAAU,EAAEC,OAAO,CAAC;IACrD,IAAIE,aAAa,GAAG,IAAI,CAACC,gBAAgB,EAAE;IAC3C,IAAI,CAACD,aAAa,IAAIF,OAAO,EAAEI,oBAAoB,EAAE;MACnDF,aAAa,GAAGF,OAAO,CAACI,oBAAoB,CAACC,KAAK;IACpD;IACA,OAAO;MACL,GAAGJ,MAAM;MACTC,aAAa;MACbI,IAAI,EAAE;QACJC,QAAQ,EAAE,IAAI;QACdC,OAAO,EAAE,IAAI,CAACC,WAAW,CAACD;MAC5B;IACF,CAAC;EACH;EAEAE,qBAAqB,GAAqB;IACxC,IAAIC,aAAa,GAAGC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACnB,MAAM,CAAC,CAACoB,MAAM,CAACC,QAAQ,IAAIA,QAAQ,KAAK,cAAc,CAAC;IAC5F,OAAOJ,aAAa,CAACK,MAAM,CAAC,CAACtB,MAAM,EAAEqB,QAAQ,MAAM;MAAC,GAAGrB,MAAM;MAAE,CAACqB,QAAQ,GAAG,IAAI,CAACrB,MAAM,CAACqB,QAAQ;IAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzG;AACF;AAAC;AAAA,8BA3BYxB,UAAU,qBACI,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Identify.js","names":["Identify","Remediator","canRemediate","identifier","getData","mapCredentials","credentials","password","values","passcode","getInputCredentials","input","form","value","name","required"],"sources":["../../../../lib/idx/remediators/Identify.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Credentials } from '../authenticator';\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface IdentifyValues extends RemediationValues {\n username?: string;\n password?: string;\n credentials?: Credentials;\n}\n\nexport class Identify extends Remediator<IdentifyValues> {\n static remediationName = 'identify';\n\n map = {\n 'identifier': ['username']\n };\n\n canRemediate(): boolean {\n const { identifier } = this.getData();\n return !!identifier;\n }\n\n mapCredentials() {\n const { credentials, password } = this.values;\n if (!credentials && !password) {\n return;\n }\n return credentials || { passcode: password };\n }\n\n getInputCredentials(input) {\n return {\n ...input.form.value[0],\n name: 'password',\n required: input.required\n };\n }\n\n}\n"],"mappings":";;;;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"Identify.js","names":["Identify","Remediator","canRemediate","identifier","getData","mapCredentials","credentials","password","values","passcode","getInputCredentials","input","form","value","name","required"],"sources":["../../../../lib/idx/remediators/Identify.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Credentials } from '../authenticator';\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface IdentifyValues extends RemediationValues {\n username?: string;\n password?: string;\n credentials?: Credentials;\n rememberMe?: boolean;\n}\n\nexport class Identify extends Remediator<IdentifyValues> {\n static remediationName = 'identify';\n\n map = {\n 'identifier': ['username']\n };\n\n canRemediate(): boolean {\n const { identifier } = this.getData();\n return !!identifier;\n }\n\n mapCredentials() {\n const { credentials, password } = this.values;\n if (!credentials && !password) {\n return;\n }\n return credentials || { passcode: password };\n }\n\n getInputCredentials(input) {\n return {\n ...input.form.value[0],\n name: 'password',\n required: input.required\n };\n }\n\n}\n"],"mappings":";;;;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaO,MAAMA,QAAQ,SAASC,sBAAU,CAAiB;EAAA;IAAA;IAAA,2CAGjD;MACJ,YAAY,EAAE,CAAC,UAAU;IAC3B,CAAC;EAAA;EAEDC,YAAY,GAAY;IACtB,MAAM;MAAEC;IAAW,CAAC,GAAG,IAAI,CAACC,OAAO,EAAE;IACrC,OAAO,CAAC,CAACD,UAAU;EACrB;EAEAE,cAAc,GAAG;IACf,MAAM;MAAEC,WAAW;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,MAAM;IAC7C,IAAI,CAACF,WAAW,IAAI,CAACC,QAAQ,EAAE;MAC7B;IACF;IACA,OAAOD,WAAW,IAAI;MAAEG,QAAQ,EAAEF;IAAS,CAAC;EAC9C;EAEAG,mBAAmB,CAACC,KAAK,EAAE;IACzB,OAAO;MACL,GAAGA,KAAK,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC;MACtBC,IAAI,EAAE,UAAU;MAChBC,QAAQ,EAAEJ,KAAK,CAACI;IAClB,CAAC;EACH;AAEF;AAAC;AAAA,8BA5BYf,QAAQ,qBACM,UAAU"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.ReEnrollAuthenticatorWarning = void 0;
|
|
5
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
6
|
+
var _ReEnrollAuthenticator = require("./ReEnrollAuthenticator");
|
|
7
|
+
/*!
|
|
8
|
+
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
+
*
|
|
11
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
*
|
|
16
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
class ReEnrollAuthenticatorWarning extends _ReEnrollAuthenticator.ReEnrollAuthenticator {}
|
|
20
|
+
exports.ReEnrollAuthenticatorWarning = ReEnrollAuthenticatorWarning;
|
|
21
|
+
(0, _defineProperty2.default)(ReEnrollAuthenticatorWarning, "remediationName", 'reenroll-authenticator-warning');
|
|
22
|
+
//# sourceMappingURL=ReEnrollAuthenticatorWarning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReEnrollAuthenticatorWarning.js","names":["ReEnrollAuthenticatorWarning","ReEnrollAuthenticator"],"sources":["../../../../lib/idx/remediators/ReEnrollAuthenticatorWarning.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { ReEnrollAuthenticator } from './ReEnrollAuthenticator';\n\nexport class ReEnrollAuthenticatorWarning extends ReEnrollAuthenticator {\n static remediationName = 'reenroll-authenticator-warning';\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,MAAMA,4BAA4B,SAASC,4CAAqB,CAAC;AAEvE;AAAA,8BAFYD,4BAA4B,qBACd,gCAAgC"}
|
|
@@ -20,14 +20,13 @@ var _types = require("../types");
|
|
|
20
20
|
|
|
21
21
|
class SelectAuthenticatorAuthenticate extends _SelectAuthenticator.SelectAuthenticator {
|
|
22
22
|
constructor(remediation, values = {}, options = {}) {
|
|
23
|
-
var _getAuthenticatorFrom;
|
|
24
23
|
super(remediation, values, options);
|
|
25
24
|
|
|
26
25
|
// Preset password authenticator to trigger recover action
|
|
27
26
|
const isRecoveryFlow = this.options.flow === 'recoverPassword';
|
|
28
|
-
const hasPasswordInOptions = (
|
|
27
|
+
const hasPasswordInOptions = (0, _util.getAuthenticatorFromRemediation)(remediation).options?.some(({
|
|
29
28
|
relatesTo
|
|
30
|
-
}) =>
|
|
29
|
+
}) => relatesTo?.key === _types.AuthenticatorKey.OKTA_PASSWORD);
|
|
31
30
|
if (hasPasswordInOptions && (isRecoveryFlow || this.values.password)) {
|
|
32
31
|
this.values.authenticators = [...(this.values.authenticators || []), {
|
|
33
32
|
key: _types.AuthenticatorKey.OKTA_PASSWORD
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectAuthenticatorAuthenticate.js","names":["SelectAuthenticatorAuthenticate","SelectAuthenticator","constructor","remediation","values","options","isRecoveryFlow","flow","hasPasswordInOptions","getAuthenticatorFromRemediation","some","relatesTo","key","AuthenticatorKey","OKTA_PASSWORD","password","authenticators"],"sources":["../../../../lib/idx/remediators/SelectAuthenticatorAuthenticate.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { getAuthenticatorFromRemediation } from './util';\nimport { IdxRemediation } from '../types/idx-js';\nimport { AuthenticatorKey, Authenticator, RemediateOptions } from '../types';\n\nexport type SelectAuthenticatorAuthenticateValues = SelectAuthenticatorValues & {\n password?: string;\n};\n\nexport class SelectAuthenticatorAuthenticate extends SelectAuthenticator<SelectAuthenticatorAuthenticateValues> {\n static remediationName = 'select-authenticator-authenticate';\n\n constructor(\n remediation: IdxRemediation, \n values: SelectAuthenticatorValues = {}, \n options: RemediateOptions = {}\n ) {\n super(remediation, values, options);\n\n // Preset password authenticator to trigger recover action\n const isRecoveryFlow = this.options.flow === 'recoverPassword';\n const hasPasswordInOptions = getAuthenticatorFromRemediation(remediation)\n .options?.some(({ relatesTo }) => relatesTo?.key === AuthenticatorKey.OKTA_PASSWORD);\n if (hasPasswordInOptions && (isRecoveryFlow || this.values.password)) {\n this.values.authenticators = [\n ...this.values.authenticators || [],\n { key: AuthenticatorKey.OKTA_PASSWORD }\n ] as Authenticator[];\n }\n }\n}\n"],"mappings":";;;;;AAaA;AACA;AAEA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,MAAMA,+BAA+B,SAASC,wCAAmB,CAAwC;EAG9GC,WAAW,CACTC,WAA2B,EAC3BC,MAAiC,GAAG,CAAC,CAAC,EACtCC,OAAyB,GAAG,CAAC,CAAC,EAC9B;
|
|
1
|
+
{"version":3,"file":"SelectAuthenticatorAuthenticate.js","names":["SelectAuthenticatorAuthenticate","SelectAuthenticator","constructor","remediation","values","options","isRecoveryFlow","flow","hasPasswordInOptions","getAuthenticatorFromRemediation","some","relatesTo","key","AuthenticatorKey","OKTA_PASSWORD","password","authenticators"],"sources":["../../../../lib/idx/remediators/SelectAuthenticatorAuthenticate.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { getAuthenticatorFromRemediation } from './util';\nimport { IdxRemediation } from '../types/idx-js';\nimport { AuthenticatorKey, Authenticator, RemediateOptions } from '../types';\n\nexport type SelectAuthenticatorAuthenticateValues = SelectAuthenticatorValues & {\n password?: string;\n};\n\nexport class SelectAuthenticatorAuthenticate extends SelectAuthenticator<SelectAuthenticatorAuthenticateValues> {\n static remediationName = 'select-authenticator-authenticate';\n\n constructor(\n remediation: IdxRemediation, \n values: SelectAuthenticatorValues = {}, \n options: RemediateOptions = {}\n ) {\n super(remediation, values, options);\n\n // Preset password authenticator to trigger recover action\n const isRecoveryFlow = this.options.flow === 'recoverPassword';\n const hasPasswordInOptions = getAuthenticatorFromRemediation(remediation)\n .options?.some(({ relatesTo }) => relatesTo?.key === AuthenticatorKey.OKTA_PASSWORD);\n if (hasPasswordInOptions && (isRecoveryFlow || this.values.password)) {\n this.values.authenticators = [\n ...this.values.authenticators || [],\n { key: AuthenticatorKey.OKTA_PASSWORD }\n ] as Authenticator[];\n }\n }\n}\n"],"mappings":";;;;;AAaA;AACA;AAEA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,MAAMA,+BAA+B,SAASC,wCAAmB,CAAwC;EAG9GC,WAAW,CACTC,WAA2B,EAC3BC,MAAiC,GAAG,CAAC,CAAC,EACtCC,OAAyB,GAAG,CAAC,CAAC,EAC9B;IACA,KAAK,CAACF,WAAW,EAAEC,MAAM,EAAEC,OAAO,CAAC;;IAEnC;IACA,MAAMC,cAAc,GAAG,IAAI,CAACD,OAAO,CAACE,IAAI,KAAK,iBAAiB;IAC9D,MAAMC,oBAAoB,GAAG,IAAAC,qCAA+B,EAACN,WAAW,CAAC,CACtEE,OAAO,EAAEK,IAAI,CAAC,CAAC;MAAEC;IAAU,CAAC,KAAKA,SAAS,EAAEC,GAAG,KAAKC,uBAAgB,CAACC,aAAa,CAAC;IACtF,IAAIN,oBAAoB,KAAKF,cAAc,IAAI,IAAI,CAACF,MAAM,CAACW,QAAQ,CAAC,EAAE;MACpE,IAAI,CAACX,MAAM,CAACY,cAAc,GAAG,CAC3B,IAAG,IAAI,CAACZ,MAAM,CAACY,cAAc,IAAI,EAAE,GACnC;QAAEJ,GAAG,EAAEC,uBAAgB,CAACC;MAAc,CAAC,CACrB;IACtB;EACF;AACF;AAAC;AAAA,8BArBYd,+BAA+B,qBACjB,mCAAmC"}
|
|
@@ -28,16 +28,15 @@ class SelectAuthenticatorUnlockAccount extends _SelectAuthenticator.SelectAuthen
|
|
|
28
28
|
return !!identifier && super.canRemediate();
|
|
29
29
|
}
|
|
30
30
|
mapAuthenticator(remediationValue) {
|
|
31
|
-
var _this$selectedOption, _methodTypeOption$opt, _methodTypeOption$opt2;
|
|
32
31
|
const authenticatorMap = super.mapAuthenticator(remediationValue);
|
|
33
|
-
const methodTypeOption =
|
|
32
|
+
const methodTypeOption = this.selectedOption?.value.form.value.find(({
|
|
34
33
|
name
|
|
35
34
|
}) => name === 'methodType');
|
|
36
35
|
|
|
37
36
|
// defaults to 'manually defined' value
|
|
38
37
|
// 2nd: option may have pre-defined value, like stateHandle
|
|
39
38
|
// 3rd: if only a single OV option is available, default to that option
|
|
40
|
-
const methodTypeValue = this.values.methodType ||
|
|
39
|
+
const methodTypeValue = this.values.methodType || methodTypeOption?.value || methodTypeOption?.options?.[0]?.value;
|
|
41
40
|
if (methodTypeValue) {
|
|
42
41
|
return {
|
|
43
42
|
...authenticatorMap,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectAuthenticatorUnlockAccount.js","names":["SelectAuthenticatorUnlockAccount","SelectAuthenticator","identifier","canRemediate","getData","mapAuthenticator","remediationValue","authenticatorMap","methodTypeOption","selectedOption","value","form","find","name","methodTypeValue","values","methodType","options","getInputUsername","type"],"sources":["../../../../lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { Authenticator } from '../types';\nimport { IdxRemediationValue } from '../types/idx-js';\n\n\nexport type SelectAuthenticatorUnlockAccountValues = SelectAuthenticatorValues & {\n identifier?: string;\n methodType?: string;\n};\n\nexport class SelectAuthenticatorUnlockAccount extends SelectAuthenticator<SelectAuthenticatorUnlockAccountValues> {\n static remediationName = 'select-authenticator-unlock-account';\n authenticator?: Authenticator;\n\n map = {\n identifier: ['username']\n };\n\n canRemediate() {\n const identifier = this.getData('identifier');\n return !!identifier && super.canRemediate();\n }\n\n mapAuthenticator(remediationValue: IdxRemediationValue) {\n const authenticatorMap = super.mapAuthenticator(remediationValue);\n const methodTypeOption = this.selectedOption?.value.form.value.find(({ name }) => name === 'methodType');\n\n // defaults to 'manually defined' value\n // 2nd: option may have pre-defined value, like stateHandle\n // 3rd: if only a single OV option is available, default to that option\n const methodTypeValue = this.values.methodType ||\n methodTypeOption?.value as string || methodTypeOption?.options?.[0]?.value as string;\n\n if (methodTypeValue) {\n return {\n ...authenticatorMap,\n methodType: methodTypeValue\n };\n }\n\n return authenticatorMap;\n }\n\n getInputUsername () {\n return { name: 'username', type: 'string' };\n }\n\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaO,MAAMA,gCAAgC,SAASC,wCAAmB,CAAyC;EAAA;IAAA;IAAA,2CAI1G;MACJC,UAAU,EAAE,CAAC,UAAU;IACzB,CAAC;EAAA;EAEDC,YAAY,GAAG;IACb,MAAMD,UAAU,GAAG,IAAI,CAACE,OAAO,CAAC,YAAY,CAAC;IAC7C,OAAO,CAAC,CAACF,UAAU,IAAI,KAAK,CAACC,YAAY,EAAE;EAC7C;EAEAE,gBAAgB,CAACC,gBAAqC,EAAE;
|
|
1
|
+
{"version":3,"file":"SelectAuthenticatorUnlockAccount.js","names":["SelectAuthenticatorUnlockAccount","SelectAuthenticator","identifier","canRemediate","getData","mapAuthenticator","remediationValue","authenticatorMap","methodTypeOption","selectedOption","value","form","find","name","methodTypeValue","values","methodType","options","getInputUsername","type"],"sources":["../../../../lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { Authenticator } from '../types';\nimport { IdxRemediationValue } from '../types/idx-js';\n\n\nexport type SelectAuthenticatorUnlockAccountValues = SelectAuthenticatorValues & {\n identifier?: string;\n methodType?: string;\n};\n\nexport class SelectAuthenticatorUnlockAccount extends SelectAuthenticator<SelectAuthenticatorUnlockAccountValues> {\n static remediationName = 'select-authenticator-unlock-account';\n authenticator?: Authenticator;\n\n map = {\n identifier: ['username']\n };\n\n canRemediate() {\n const identifier = this.getData('identifier');\n return !!identifier && super.canRemediate();\n }\n\n mapAuthenticator(remediationValue: IdxRemediationValue) {\n const authenticatorMap = super.mapAuthenticator(remediationValue);\n const methodTypeOption = this.selectedOption?.value.form.value.find(({ name }) => name === 'methodType');\n\n // defaults to 'manually defined' value\n // 2nd: option may have pre-defined value, like stateHandle\n // 3rd: if only a single OV option is available, default to that option\n const methodTypeValue = this.values.methodType ||\n methodTypeOption?.value as string || methodTypeOption?.options?.[0]?.value as string;\n\n if (methodTypeValue) {\n return {\n ...authenticatorMap,\n methodType: methodTypeValue\n };\n }\n\n return authenticatorMap;\n }\n\n getInputUsername () {\n return { name: 'username', type: 'string' };\n }\n\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaO,MAAMA,gCAAgC,SAASC,wCAAmB,CAAyC;EAAA;IAAA;IAAA,2CAI1G;MACJC,UAAU,EAAE,CAAC,UAAU;IACzB,CAAC;EAAA;EAEDC,YAAY,GAAG;IACb,MAAMD,UAAU,GAAG,IAAI,CAACE,OAAO,CAAC,YAAY,CAAC;IAC7C,OAAO,CAAC,CAACF,UAAU,IAAI,KAAK,CAACC,YAAY,EAAE;EAC7C;EAEAE,gBAAgB,CAACC,gBAAqC,EAAE;IACtD,MAAMC,gBAAgB,GAAG,KAAK,CAACF,gBAAgB,CAACC,gBAAgB,CAAC;IACjE,MAAME,gBAAgB,GAAG,IAAI,CAACC,cAAc,EAAEC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACE,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,KAAK,YAAY,CAAC;;IAExG;IACA;IACA;IACA,MAAMC,eAAe,GAAG,IAAI,CAACC,MAAM,CAACC,UAAU,IAC5CR,gBAAgB,EAAEE,KAAe,IAAIF,gBAAgB,EAAES,OAAO,GAAG,CAAC,CAAC,EAAEP,KAAe;IAEtF,IAAII,eAAe,EAAE;MACnB,OAAO;QACL,GAAGP,gBAAgB;QACnBS,UAAU,EAAEF;MACd,CAAC;IACH;IAEA,OAAOP,gBAAgB;EACzB;EAEAW,gBAAgB,GAAI;IAClB,OAAO;MAAEL,IAAI,EAAE,UAAU;MAAEM,IAAI,EAAE;IAAS,CAAC;EAC7C;AAEF;AAAC;AAAA,8BArCYnB,gCAAgC,qBAClB,qCAAqC"}
|
|
@@ -41,13 +41,12 @@ class SelectEnrollmentChannel extends _Remediator.Remediator {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
getData() {
|
|
44
|
-
var _this$values$authenti;
|
|
45
44
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
45
|
const remediationValue = this.remediation.value[0].value;
|
|
47
46
|
return {
|
|
48
47
|
authenticator: {
|
|
49
48
|
id: remediationValue.form.value[0].value,
|
|
50
|
-
channel:
|
|
49
|
+
channel: this.values.authenticator?.channel || this.values.channel
|
|
51
50
|
},
|
|
52
51
|
stateHandle: this.values.stateHandle
|
|
53
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectEnrollmentChannel.js","names":["SelectEnrollmentChannel","Remediator","canRemediate","values","channel","authenticator","id","getNextStep","authClient","context","common","currentAuthenticator","value","getData","remediationValue","remediation","form","stateHandle","getValuesAfterProceed","authenticators","filterKey","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../lib/idx/remediators/SelectEnrollmentChannel.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { IdxRemediationValueForm, IdxContext } from '../types/idx-js';\nimport { Authenticator, OktaAuthIdxInterface } from '../types/api';\n\n\nexport type SelectEnrollmentChannelValues = RemediationValues & {\n channel?: string;\n};\n\nexport class SelectEnrollmentChannel extends Remediator<SelectEnrollmentChannelValues> {\n static remediationName = 'select-enrollment-channel';\n\n canRemediate() {\n if (this.values.channel) {\n return true;\n }\n\n if (this.values.authenticator) {\n const { id, channel } = this.values.authenticator as Authenticator;\n if (!!id && !!channel) {\n return true;\n }\n }\n\n return false;\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context: IdxContext) {\n const common = super.getNextStep(authClient, context);\n const authenticator = context.currentAuthenticator.value;\n return {\n ...common,\n authenticator,\n };\n }\n\n getData() {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const remediationValue = this.remediation!.value![0].value as IdxRemediationValueForm;\n return {\n authenticator: {\n id: remediationValue.form.value[0].value,\n channel: (this.values.authenticator as Authenticator)?.channel || this.values.channel,\n },\n stateHandle: this.values.stateHandle,\n\n };\n }\n\n getValuesAfterProceed(): SelectEnrollmentChannelValues {\n this.values = super.getValuesAfterProceed();\n delete this.values.authenticators; // required to prevent infinite loops from auto-remediating via values\n const filterKey = this.values.channel ? 'channel' : 'authenticator';\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== filterKey);\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,MAAMA,uBAAuB,SAASC,sBAAU,CAAgC;EAGrFC,YAAY,GAAG;IACb,IAAI,IAAI,CAACC,MAAM,CAACC,OAAO,EAAE;MACvB,OAAO,IAAI;IACb;IAEA,IAAI,IAAI,CAACD,MAAM,CAACE,aAAa,EAAE;MAC7B,MAAM;QAAEC,EAAE;QAAEF;MAAQ,CAAC,GAAG,IAAI,CAACD,MAAM,CAACE,aAA8B;MAClE,IAAI,CAAC,CAACC,EAAE,IAAI,CAAC,CAACF,OAAO,EAAE;QACrB,OAAO,IAAI;MACb;IACF;IAEA,OAAO,KAAK;EACd;EAEAG,WAAW,CAACC,UAAgC,EAAEC,OAAmB,EAAE;IACjE,MAAMC,MAAM,GAAG,KAAK,CAACH,WAAW,CAACC,UAAU,EAAEC,OAAO,CAAC;IACrD,MAAMJ,aAAa,GAAGI,OAAO,CAACE,oBAAoB,CAACC,KAAK;IACxD,OAAO;MACL,GAAGF,MAAM;MACTL;IACF,CAAC;EACH;EAEAQ,OAAO,GAAG;
|
|
1
|
+
{"version":3,"file":"SelectEnrollmentChannel.js","names":["SelectEnrollmentChannel","Remediator","canRemediate","values","channel","authenticator","id","getNextStep","authClient","context","common","currentAuthenticator","value","getData","remediationValue","remediation","form","stateHandle","getValuesAfterProceed","authenticators","filterKey","trimmedValues","Object","keys","filter","valueKey","reduce"],"sources":["../../../../lib/idx/remediators/SelectEnrollmentChannel.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { IdxRemediationValueForm, IdxContext } from '../types/idx-js';\nimport { Authenticator, OktaAuthIdxInterface } from '../types/api';\n\n\nexport type SelectEnrollmentChannelValues = RemediationValues & {\n channel?: string;\n};\n\nexport class SelectEnrollmentChannel extends Remediator<SelectEnrollmentChannelValues> {\n static remediationName = 'select-enrollment-channel';\n\n canRemediate() {\n if (this.values.channel) {\n return true;\n }\n\n if (this.values.authenticator) {\n const { id, channel } = this.values.authenticator as Authenticator;\n if (!!id && !!channel) {\n return true;\n }\n }\n\n return false;\n }\n\n getNextStep(authClient: OktaAuthIdxInterface, context: IdxContext) {\n const common = super.getNextStep(authClient, context);\n const authenticator = context.currentAuthenticator.value;\n return {\n ...common,\n authenticator,\n };\n }\n\n getData() {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const remediationValue = this.remediation!.value![0].value as IdxRemediationValueForm;\n return {\n authenticator: {\n id: remediationValue.form.value[0].value,\n channel: (this.values.authenticator as Authenticator)?.channel || this.values.channel,\n },\n stateHandle: this.values.stateHandle,\n\n };\n }\n\n getValuesAfterProceed(): SelectEnrollmentChannelValues {\n this.values = super.getValuesAfterProceed();\n delete this.values.authenticators; // required to prevent infinite loops from auto-remediating via values\n const filterKey = this.values.channel ? 'channel' : 'authenticator';\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== filterKey);\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"mappings":";;;;;AAaA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,MAAMA,uBAAuB,SAASC,sBAAU,CAAgC;EAGrFC,YAAY,GAAG;IACb,IAAI,IAAI,CAACC,MAAM,CAACC,OAAO,EAAE;MACvB,OAAO,IAAI;IACb;IAEA,IAAI,IAAI,CAACD,MAAM,CAACE,aAAa,EAAE;MAC7B,MAAM;QAAEC,EAAE;QAAEF;MAAQ,CAAC,GAAG,IAAI,CAACD,MAAM,CAACE,aAA8B;MAClE,IAAI,CAAC,CAACC,EAAE,IAAI,CAAC,CAACF,OA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AAC;EACzG;AACF;AAAC;AAAA,8BA/CYzB,uBAAuB,qBACT,2BAA2B"}
|
|
@@ -121,6 +121,17 @@ Object.keys(_ReEnrollAuthenticator).forEach(function (key) {
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
|
+
var _ReEnrollAuthenticatorWarning = require("./ReEnrollAuthenticatorWarning");
|
|
125
|
+
Object.keys(_ReEnrollAuthenticatorWarning).forEach(function (key) {
|
|
126
|
+
if (key === "default" || key === "__esModule") return;
|
|
127
|
+
if (key in exports && exports[key] === _ReEnrollAuthenticatorWarning[key]) return;
|
|
128
|
+
Object.defineProperty(exports, key, {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function () {
|
|
131
|
+
return _ReEnrollAuthenticatorWarning[key];
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
124
135
|
var _RedirectIdp = require("./RedirectIdp");
|
|
125
136
|
Object.keys(_RedirectIdp).forEach(function (key) {
|
|
126
137
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../lib/idx/remediators/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nexport * from './Base/Remediator';\nexport * from './EnrollAuthenticator';\nexport * from './EnrollPoll';\nexport * from './SelectEnrollmentChannel';\nexport * from './EnrollmentChannelData';\nexport * from './ChallengeAuthenticator';\nexport * from './ChallengePoll';\nexport * from './ResetAuthenticator';\nexport * from './EnrollProfile';\nexport * from './Identify';\nexport * from './ReEnrollAuthenticator';\nexport * from './RedirectIdp';\nexport * from './SelectAuthenticatorAuthenticate';\nexport * from './SelectAuthenticatorEnroll';\nexport * from './SelectAuthenticatorUnlockAccount';\nexport * from './SelectEnrollProfile';\nexport * from './AuthenticatorVerificationData';\nexport * from './AuthenticatorEnrollmentData';\nexport * from './Skip';\nexport * from './GenericRemediator';\n"],"mappings":";;AAaA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../lib/idx/remediators/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nexport * from './Base/Remediator';\nexport * from './EnrollAuthenticator';\nexport * from './EnrollPoll';\nexport * from './SelectEnrollmentChannel';\nexport * from './EnrollmentChannelData';\nexport * from './ChallengeAuthenticator';\nexport * from './ChallengePoll';\nexport * from './ResetAuthenticator';\nexport * from './EnrollProfile';\nexport * from './Identify';\nexport * from './ReEnrollAuthenticator';\nexport * from './ReEnrollAuthenticatorWarning';\nexport * from './RedirectIdp';\nexport * from './SelectAuthenticatorAuthenticate';\nexport * from './SelectAuthenticatorEnroll';\nexport * from './SelectAuthenticatorUnlockAccount';\nexport * from './SelectEnrollProfile';\nexport * from './AuthenticatorVerificationData';\nexport * from './AuthenticatorEnrollmentData';\nexport * from './Skip';\nexport * from './GenericRemediator';\n"],"mappings":";;AAaA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;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A;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -17,12 +17,10 @@ exports.titleCase = titleCase;
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
function getAllValues(idxRemediation) {
|
|
20
|
-
|
|
21
|
-
return (_idxRemediation$value = idxRemediation.value) === null || _idxRemediation$value === void 0 ? void 0 : _idxRemediation$value.map(r => r.name);
|
|
20
|
+
return idxRemediation.value?.map(r => r.name);
|
|
22
21
|
}
|
|
23
22
|
function getRequiredValues(idxRemediation) {
|
|
24
|
-
|
|
25
|
-
return (_idxRemediation$value2 = idxRemediation.value) === null || _idxRemediation$value2 === void 0 ? void 0 : _idxRemediation$value2.reduce((required, cur) => {
|
|
23
|
+
return idxRemediation.value?.reduce((required, cur) => {
|
|
26
24
|
if (cur.required) {
|
|
27
25
|
required.push(cur.name);
|
|
28
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","names":["getAllValues","idxRemediation","value","map","r","name","getRequiredValues","reduce","required","cur","push","titleCase","str","charAt","toUpperCase","substring","getAuthenticatorFromRemediation","remediation","find"],"sources":["../../../../lib/idx/remediators/util.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { IdxRemediation, IdxRemediationValue } from '../types/idx-js';\n\nexport function getAllValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.map(r => r.name);\n}\n\nexport function getRequiredValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.reduce((required, cur) => {\n if (cur.required) {\n required.push(cur.name as never);\n }\n return required;\n }, []);\n}\n\nexport function titleCase(str: string) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\nexport function getAuthenticatorFromRemediation(\n remediation: IdxRemediation\n): IdxRemediationValue {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return remediation.value!.find(({ name }) => name === 'authenticator') as IdxRemediationValue;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,SAASA,YAAY,CAACC,cAA8B,EAAE;
|
|
1
|
+
{"version":3,"file":"util.js","names":["getAllValues","idxRemediation","value","map","r","name","getRequiredValues","reduce","required","cur","push","titleCase","str","charAt","toUpperCase","substring","getAuthenticatorFromRemediation","remediation","find"],"sources":["../../../../lib/idx/remediators/util.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { IdxRemediation, IdxRemediationValue } from '../types/idx-js';\n\nexport function getAllValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.map(r => r.name);\n}\n\nexport function getRequiredValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.reduce((required, cur) => {\n if (cur.required) {\n required.push(cur.name as never);\n }\n return required;\n }, []);\n}\n\nexport function titleCase(str: string) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\nexport function getAuthenticatorFromRemediation(\n remediation: IdxRemediation\n): IdxRemediationValue {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return remediation.value!.find(({ name }) => name === 'authenticator') as IdxRemediationValue;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,SAASA,YAAY,CAACC,cAA8B,EAAE;EAC3D,OAAOA,cAAc,CAACC,KAAK,EAAEC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,IAAI,CAAC;AAC/C;AAEO,SAASC,iBAAiB,CAACL,cAA8B,EAAE;EAChE,OAAOA,cAAc,CAACC,KAAK,EAAEK,MAAM,CAAC,CAACC,QAAQ,EAAEC,GAAG,KAAK;IACrD,IAAIA,GAAG,CAACD,QAAQ,EAAE;MAChBA,QAAQ,CAACE,IAAI,CAACD,GAAG,CAACJ,IAAI,CAAU;IAClC;IACA,OAAOG,QAAQ;EACjB,CAAC,EAAE,EAAE,CAAC;AACR;AAEO,SAASG,SAAS,CAACC,GAAW,EAAE;EACrC,OAAOA,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,GAAGF,GAAG,CAACG,SAAS,CAAC,CAAC,CAAC;AACvD;AAEO,SAASC,+BAA+B,CAC7CC,WAA2B,EACN;EACrB;EACA,OAAOA,WAAW,CAACf,KAAK,CAAEgB,IAAI,CAAC,CAAC;IAAEb;EAAK,CAAC,KAAKA,IAAI,KAAK,eAAe,CAAC;AACxE"}
|