@thunderid/react 0.3.0 → 0.3.3
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/dist/ThunderIDReactClient.d.ts +4 -4
- package/dist/ThunderIDReactClient.d.ts.map +1 -1
- package/dist/ThunderIDReactClient.js +6 -6
- package/dist/ThunderIDReactClient.js.map +1 -1
- package/dist/cjs/ThunderIDReactClient.cjs +5 -5
- package/dist/cjs/ThunderIDReactClient.cjs.map +1 -1
- package/dist/cjs/components/actions/SignInButton/SignInButton.cjs.map +1 -1
- package/dist/cjs/components/adapters/Consent.cjs.map +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs.map +1 -1
- package/dist/cjs/components/auth/Callback/Callback.cjs +1 -1
- package/dist/cjs/components/auth/Callback/Callback.cjs.map +1 -1
- package/dist/cjs/components/auth/Callback/TokenCallback.cjs +3 -3
- package/dist/cjs/components/auth/Callback/TokenCallback.cjs.map +1 -1
- package/dist/cjs/components/factories/FieldFactory.cjs +2 -2
- package/dist/cjs/components/factories/FieldFactory.cjs.map +1 -1
- package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.cjs +1 -1
- package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.cjs +1 -1
- package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.cjs +3 -3
- package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.cjs → AcceptInvite.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/AcceptInvite/AcceptInvite.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.cjs → BaseAcceptInvite.cjs} +47 -18
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.cjs → BaseAcceptInvite.styles.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs +50 -32
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/InviteUser/{v2/BaseInviteUser.cjs → BaseInviteUser.cjs} +44 -15
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.cjs → BaseInviteUser.styles.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.styles.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/InviteUser/{v2/InviteUser.cjs → InviteUser.cjs} +3 -3
- package/dist/cjs/components/presentation/auth/InviteUser/InviteUser.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.cjs → OrganizationUnitPicker.cjs} +3 -3
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.cjs → OrganizationUnitPicker.styles.cjs} +2 -2
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.cjs.map +1 -0
- package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs +389 -8
- package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/Recovery/Recovery.cjs +51 -22
- package/dist/cjs/components/presentation/auth/Recovery/Recovery.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs +346 -8
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs +547 -36
- package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs +691 -8
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignUp/SignUp.cjs +66 -76
- package/dist/cjs/components/presentation/auth/SignUp/SignUp.cjs.map +1 -1
- package/dist/cjs/components/primitives/Alert/Alert.cjs +1 -1
- package/dist/cjs/components/primitives/Checkbox/Checkbox.cjs +1 -1
- package/dist/cjs/components/primitives/FormControl/FormControl.cjs +1 -1
- package/dist/cjs/components/primitives/Toggle/Toggle.cjs +1 -1
- package/dist/cjs/contexts/ComponentRenderer/ComponentRendererContext.cjs.map +1 -1
- package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs +5 -7
- package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs.map +1 -1
- package/dist/cjs/contexts/Theme/ThemeProvider.cjs +76 -37
- package/dist/cjs/contexts/Theme/ThemeProvider.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs +0 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs +0 -3
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
- package/dist/cjs/hooks/{v2/useOAuthCallback.cjs → useOAuthCallback.cjs} +2 -2
- package/dist/cjs/hooks/useOAuthCallback.cjs.map +1 -0
- package/dist/cjs/index.cjs +47 -50
- package/dist/cjs/utils/{v2/buildThemeConfigFromFlowMeta.cjs → buildThemeConfigFromFlowMeta.cjs} +1 -1
- package/dist/cjs/utils/buildThemeConfigFromFlowMeta.cjs.map +1 -0
- package/dist/cjs/utils/{v2/flowTransformer.cjs → flowTransformer.cjs} +1 -1
- package/dist/cjs/utils/flowTransformer.cjs.map +1 -0
- package/dist/cjs/utils/{v2/getAuthComponentHeadings.cjs → getAuthComponentHeadings.cjs} +1 -1
- package/dist/cjs/utils/getAuthComponentHeadings.cjs.map +1 -0
- package/dist/cjs/utils/{v2/passkey.cjs → passkey.cjs} +2 -2
- package/dist/cjs/utils/passkey.cjs.map +1 -0
- package/dist/cjs/utils/{v2/resolveTranslationsInArray.cjs → resolveTranslationsInArray.cjs} +1 -1
- package/dist/cjs/utils/resolveTranslationsInArray.cjs.map +1 -0
- package/dist/cjs/utils/{v2/resolveTranslationsInObject.cjs → resolveTranslationsInObject.cjs} +2 -2
- package/dist/cjs/utils/resolveTranslationsInObject.cjs.map +1 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts.map +1 -1
- package/dist/components/actions/SignInButton/SignInButton.js.map +1 -1
- package/dist/components/adapters/Consent.d.ts +1 -1
- package/dist/components/adapters/Consent.d.ts.map +1 -1
- package/dist/components/adapters/Consent.js.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.d.ts +1 -1
- package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.js +1 -1
- package/dist/components/adapters/ConsentCheckboxList.js.map +1 -1
- package/dist/components/auth/Callback/Callback.d.ts +1 -1
- package/dist/components/auth/Callback/Callback.js +1 -1
- package/dist/components/auth/Callback/Callback.js.map +1 -1
- package/dist/components/auth/Callback/TokenCallback.js +4 -4
- package/dist/components/auth/Callback/TokenCallback.js.map +1 -1
- package/dist/components/factories/FieldFactory.d.ts +2 -2
- package/dist/components/factories/FieldFactory.js +2 -2
- package/dist/components/factories/FieldFactory.js.map +1 -1
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.js +1 -1
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.js +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.js +3 -3
- package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.js → AcceptInvite.js} +1 -1
- package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.js.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.d.ts → BaseAcceptInvite.d.ts} +3 -2
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.js → BaseAcceptInvite.js} +45 -17
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.js.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.js → BaseAcceptInvite.styles.js} +1 -1
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.js.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts +4 -4
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.js +51 -33
- package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
- package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.d.ts → BaseInviteUser.d.ts} +3 -2
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.js → BaseInviteUser.js} +44 -15
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.js.map +1 -0
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.js → BaseInviteUser.styles.js} +1 -1
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.js.map +1 -0
- package/dist/components/presentation/auth/InviteUser/InviteUser.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/{v2/InviteUser.js → InviteUser.js} +2 -2
- package/dist/components/presentation/auth/InviteUser/InviteUser.js.map +1 -0
- package/dist/components/presentation/auth/InviteUser/index.d.ts +4 -4
- package/dist/components/presentation/auth/InviteUser/index.d.ts.map +1 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.d.ts.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.js → OrganizationUnitPicker.js} +2 -2
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.js.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.js → OrganizationUnitPicker.styles.js} +1 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.js.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts +2 -2
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts +63 -4
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.js +389 -10
- package/dist/components/presentation/auth/Recovery/BaseRecovery.js.map +1 -1
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts +21 -22
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/Recovery.js +51 -23
- package/dist/components/presentation/auth/Recovery/Recovery.js.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts +213 -6
- package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.js +346 -10
- package/dist/components/presentation/auth/SignIn/BaseSignIn.js.map +1 -1
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts +122 -13
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignIn/SignIn.js +548 -38
- package/dist/components/presentation/auth/SignIn/SignIn.js.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts +164 -6
- package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.js +691 -10
- package/dist/components/presentation/auth/SignUp/BaseSignUp.js.map +1 -1
- package/dist/components/presentation/auth/SignUp/SignUp.d.ts +15 -74
- package/dist/components/presentation/auth/SignUp/SignUp.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignUp/SignUp.js +67 -77
- package/dist/components/presentation/auth/SignUp/SignUp.js.map +1 -1
- package/dist/components/primitives/Alert/Alert.js +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.js +1 -1
- package/dist/components/primitives/FormControl/FormControl.js +1 -1
- package/dist/components/primitives/Toggle/Toggle.js +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts.map +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.js.map +1 -1
- package/dist/contexts/FlowMeta/FlowMetaProvider.d.ts.map +1 -1
- package/dist/contexts/FlowMeta/FlowMetaProvider.js +6 -8
- package/dist/contexts/FlowMeta/FlowMetaProvider.js.map +1 -1
- package/dist/contexts/Theme/ThemeProvider.d.ts +19 -39
- package/dist/contexts/Theme/ThemeProvider.d.ts.map +1 -1
- package/dist/contexts/Theme/ThemeProvider.js +76 -38
- package/dist/contexts/Theme/ThemeProvider.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts +1 -2
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.js +0 -1
- package/dist/contexts/ThunderID/ThunderIDContext.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.js +1 -4
- package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
- package/dist/hooks/useOAuthCallback.d.ts.map +1 -0
- package/dist/hooks/{v2/useOAuthCallback.js → useOAuthCallback.js} +1 -1
- package/dist/hooks/useOAuthCallback.js.map +1 -0
- package/dist/index.d.ts +3 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -35
- package/dist/utils/buildThemeConfigFromFlowMeta.d.ts.map +1 -0
- package/dist/utils/{v2/buildThemeConfigFromFlowMeta.js → buildThemeConfigFromFlowMeta.js} +1 -1
- package/dist/utils/buildThemeConfigFromFlowMeta.js.map +1 -0
- package/dist/utils/{v2/flowTransformer.d.ts → flowTransformer.d.ts} +3 -3
- package/dist/utils/flowTransformer.d.ts.map +1 -0
- package/dist/utils/{v2/flowTransformer.js → flowTransformer.js} +1 -1
- package/dist/utils/flowTransformer.js.map +1 -0
- package/dist/utils/{v2/getAuthComponentHeadings.d.ts → getAuthComponentHeadings.d.ts} +1 -1
- package/dist/utils/getAuthComponentHeadings.d.ts.map +1 -0
- package/dist/utils/{v2/getAuthComponentHeadings.js → getAuthComponentHeadings.js} +1 -1
- package/dist/utils/getAuthComponentHeadings.js.map +1 -0
- package/dist/utils/passkey.d.ts.map +1 -0
- package/dist/utils/{v2/passkey.js → passkey.js} +1 -1
- package/dist/utils/passkey.js.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInArray.d.ts → resolveTranslationsInArray.d.ts} +1 -1
- package/dist/utils/resolveTranslationsInArray.d.ts.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInArray.js → resolveTranslationsInArray.js} +1 -1
- package/dist/utils/resolveTranslationsInArray.js.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInObject.d.ts → resolveTranslationsInObject.d.ts} +1 -1
- package/dist/utils/resolveTranslationsInObject.d.ts.map +1 -0
- package/dist/utils/{v2/resolveTranslationsInObject.js → resolveTranslationsInObject.js} +1 -1
- package/dist/utils/resolveTranslationsInObject.js.map +1 -0
- package/package.json +10 -10
- package/dist/cjs/components/adapters/CheckboxInput.cjs +0 -30
- package/dist/cjs/components/adapters/CheckboxInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/DateInput.cjs +0 -30
- package/dist/cjs/components/adapters/DateInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/DividerComponent.cjs +0 -24
- package/dist/cjs/components/adapters/DividerComponent.cjs.map +0 -1
- package/dist/cjs/components/adapters/EmailInput.cjs +0 -30
- package/dist/cjs/components/adapters/EmailInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/FormContainer.cjs +0 -36
- package/dist/cjs/components/adapters/FormContainer.cjs.map +0 -1
- package/dist/cjs/components/adapters/NumberInput.cjs +0 -30
- package/dist/cjs/components/adapters/NumberInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/PasswordInput.cjs +0 -52
- package/dist/cjs/components/adapters/PasswordInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/SelectInput.cjs +0 -36
- package/dist/cjs/components/adapters/SelectInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/SubmitButton.cjs +0 -61
- package/dist/cjs/components/adapters/SubmitButton.cjs.map +0 -1
- package/dist/cjs/components/adapters/TelephoneInput.cjs +0 -32
- package/dist/cjs/components/adapters/TelephoneInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/TextInput.cjs +0 -30
- package/dist/cjs/components/adapters/TextInput.cjs.map +0 -1
- package/dist/cjs/components/adapters/Typography.cjs +0 -60
- package/dist/cjs/components/adapters/Typography.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/v2/AcceptInvite.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/InviteUser/v2/BaseInviteUser.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/InviteUser/v2/InviteUser.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v1/BaseRecovery.cjs +0 -293
- package/dist/cjs/components/presentation/auth/Recovery/v1/BaseRecovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v1/Recovery.cjs +0 -43
- package/dist/cjs/components/presentation/auth/Recovery/v1/Recovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.cjs +0 -163
- package/dist/cjs/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v2/BaseRecovery.cjs +0 -378
- package/dist/cjs/components/presentation/auth/Recovery/v2/BaseRecovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/Recovery/v2/Recovery.cjs +0 -78
- package/dist/cjs/components/presentation/auth/Recovery/v2/Recovery.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/BaseSignIn.cjs +0 -734
- package/dist/cjs/components/presentation/auth/SignIn/v1/BaseSignIn.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/EmailOtp.cjs +0 -68
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/EmailOtp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/IdentifierFirst.cjs +0 -59
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/IdentifierFirst.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/MultiOptionButton.cjs +0 -139
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/MultiOptionButton.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.cjs +0 -147
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SmsOtp.cjs +0 -68
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SmsOtp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SocialButton.cjs +0 -38
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/SocialButton.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/Totp.cjs +0 -68
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/Totp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/UsernamePassword.cjs +0 -60
- package/dist/cjs/components/presentation/auth/SignIn/v1/options/UsernamePassword.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v2/BaseSignIn.cjs +0 -330
- package/dist/cjs/components/presentation/auth/SignIn/v2/BaseSignIn.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignIn/v2/SignIn.cjs +0 -560
- package/dist/cjs/components/presentation/auth/SignIn/v2/SignIn.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v1/BaseSignUp.cjs +0 -451
- package/dist/cjs/components/presentation/auth/SignUp/v1/BaseSignUp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUp.cjs +0 -54
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUpOptionFactory.cjs +0 -164
- package/dist/cjs/components/presentation/auth/SignUp/v1/SignUpOptionFactory.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v2/BaseSignUp.cjs +0 -679
- package/dist/cjs/components/presentation/auth/SignUp/v2/BaseSignUp.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/SignUp/v2/SignUp.cjs +0 -80
- package/dist/cjs/components/presentation/auth/SignUp/v2/SignUp.cjs.map +0 -1
- package/dist/cjs/contexts/Theme/v1/ThemeProvider.cjs +0 -190
- package/dist/cjs/contexts/Theme/v1/ThemeProvider.cjs.map +0 -1
- package/dist/cjs/contexts/Theme/v2/ThemeProvider.cjs +0 -108
- package/dist/cjs/contexts/Theme/v2/ThemeProvider.cjs.map +0 -1
- package/dist/cjs/hooks/v2/useOAuthCallback.cjs.map +0 -1
- package/dist/cjs/utils/v2/buildThemeConfigFromFlowMeta.cjs.map +0 -1
- package/dist/cjs/utils/v2/flowTransformer.cjs.map +0 -1
- package/dist/cjs/utils/v2/getAuthComponentHeadings.cjs.map +0 -1
- package/dist/cjs/utils/v2/passkey.cjs.map +0 -1
- package/dist/cjs/utils/v2/resolveTranslationsInArray.cjs.map +0 -1
- package/dist/cjs/utils/v2/resolveTranslationsInObject.cjs.map +0 -1
- package/dist/components/adapters/CheckboxInput.d.ts +0 -25
- package/dist/components/adapters/CheckboxInput.d.ts.map +0 -1
- package/dist/components/adapters/CheckboxInput.js +0 -28
- package/dist/components/adapters/CheckboxInput.js.map +0 -1
- package/dist/components/adapters/DateInput.d.ts +0 -25
- package/dist/components/adapters/DateInput.d.ts.map +0 -1
- package/dist/components/adapters/DateInput.js +0 -28
- package/dist/components/adapters/DateInput.js.map +0 -1
- package/dist/components/adapters/DividerComponent.d.ts +0 -25
- package/dist/components/adapters/DividerComponent.d.ts.map +0 -1
- package/dist/components/adapters/DividerComponent.js +0 -22
- package/dist/components/adapters/DividerComponent.js.map +0 -1
- package/dist/components/adapters/EmailInput.d.ts +0 -25
- package/dist/components/adapters/EmailInput.d.ts.map +0 -1
- package/dist/components/adapters/EmailInput.js +0 -28
- package/dist/components/adapters/EmailInput.js.map +0 -1
- package/dist/components/adapters/FormContainer.d.ts +0 -25
- package/dist/components/adapters/FormContainer.d.ts.map +0 -1
- package/dist/components/adapters/FormContainer.js +0 -34
- package/dist/components/adapters/FormContainer.js.map +0 -1
- package/dist/components/adapters/NumberInput.d.ts +0 -25
- package/dist/components/adapters/NumberInput.d.ts.map +0 -1
- package/dist/components/adapters/NumberInput.js +0 -28
- package/dist/components/adapters/NumberInput.js.map +0 -1
- package/dist/components/adapters/PasswordInput.d.ts +0 -25
- package/dist/components/adapters/PasswordInput.d.ts.map +0 -1
- package/dist/components/adapters/PasswordInput.js +0 -50
- package/dist/components/adapters/PasswordInput.js.map +0 -1
- package/dist/components/adapters/SelectInput.d.ts +0 -25
- package/dist/components/adapters/SelectInput.d.ts.map +0 -1
- package/dist/components/adapters/SelectInput.js +0 -34
- package/dist/components/adapters/SelectInput.js.map +0 -1
- package/dist/components/adapters/SocialButton.d.ts +0 -25
- package/dist/components/adapters/SocialButton.d.ts.map +0 -1
- package/dist/components/adapters/SubmitButton.d.ts +0 -25
- package/dist/components/adapters/SubmitButton.d.ts.map +0 -1
- package/dist/components/adapters/SubmitButton.js +0 -59
- package/dist/components/adapters/SubmitButton.js.map +0 -1
- package/dist/components/adapters/TelephoneInput.d.ts +0 -25
- package/dist/components/adapters/TelephoneInput.d.ts.map +0 -1
- package/dist/components/adapters/TelephoneInput.js +0 -30
- package/dist/components/adapters/TelephoneInput.js.map +0 -1
- package/dist/components/adapters/TextInput.d.ts +0 -25
- package/dist/components/adapters/TextInput.d.ts.map +0 -1
- package/dist/components/adapters/TextInput.js +0 -28
- package/dist/components/adapters/TextInput.js.map +0 -1
- package/dist/components/adapters/Typography.d.ts +0 -25
- package/dist/components/adapters/Typography.d.ts.map +0 -1
- package/dist/components/adapters/Typography.js +0 -58
- package/dist/components/adapters/Typography.js.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.js.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.js.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts.map +0 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.js.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.js.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.js.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts.map +0 -1
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.js.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.d.ts.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.js.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.d.ts.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts +0 -74
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.js +0 -288
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts +0 -26
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/Recovery.js +0 -40
- package/dist/components/presentation/auth/Recovery/v1/Recovery.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts +0 -46
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.js +0 -160
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts +0 -83
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.js +0 -373
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.js.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts +0 -56
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts.map +0 -1
- package/dist/components/presentation/auth/Recovery/v2/Recovery.js +0 -74
- package/dist/components/presentation/auth/Recovery/v2/Recovery.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts +0 -131
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.js +0 -729
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.js +0 -64
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.js +0 -55
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts +0 -27
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.js +0 -136
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts +0 -77
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.js +0 -143
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.js +0 -64
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.js +0 -36
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.js +0 -64
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts +0 -26
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.js +0 -56
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts +0 -125
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +0 -222
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.js +0 -325
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.js.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +0 -165
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignIn/v2/SignIn.js +0 -556
- package/dist/components/presentation/auth/SignIn/v2/SignIn.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts +0 -174
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.js +0 -446
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts +0 -39
- package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUp.js +0 -51
- package/dist/components/presentation/auth/SignUp/v1/SignUp.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +0 -46
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.js +0 -160
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts +0 -186
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.js +0 -674
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.js.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts +0 -39
- package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts.map +0 -1
- package/dist/components/presentation/auth/SignUp/v2/SignUp.js +0 -77
- package/dist/components/presentation/auth/SignUp/v2/SignUp.js.map +0 -1
- package/dist/contexts/Theme/v1/ThemeProvider.d.ts +0 -89
- package/dist/contexts/Theme/v1/ThemeProvider.d.ts.map +0 -1
- package/dist/contexts/Theme/v1/ThemeProvider.js +0 -186
- package/dist/contexts/Theme/v1/ThemeProvider.js.map +0 -1
- package/dist/contexts/Theme/v2/ThemeProvider.d.ts +0 -58
- package/dist/contexts/Theme/v2/ThemeProvider.d.ts.map +0 -1
- package/dist/contexts/Theme/v2/ThemeProvider.js +0 -104
- package/dist/contexts/Theme/v2/ThemeProvider.js.map +0 -1
- package/dist/hooks/v2/useOAuthCallback.d.ts.map +0 -1
- package/dist/hooks/v2/useOAuthCallback.js.map +0 -1
- package/dist/utils/v2/buildThemeConfigFromFlowMeta.d.ts.map +0 -1
- package/dist/utils/v2/buildThemeConfigFromFlowMeta.js.map +0 -1
- package/dist/utils/v2/flowTransformer.d.ts.map +0 -1
- package/dist/utils/v2/flowTransformer.js.map +0 -1
- package/dist/utils/v2/getAuthComponentHeadings.d.ts.map +0 -1
- package/dist/utils/v2/getAuthComponentHeadings.js.map +0 -1
- package/dist/utils/v2/passkey.d.ts.map +0 -1
- package/dist/utils/v2/passkey.js.map +0 -1
- package/dist/utils/v2/resolveTranslationsInArray.d.ts.map +0 -1
- package/dist/utils/v2/resolveTranslationsInArray.js.map +0 -1
- package/dist/utils/v2/resolveTranslationsInObject.d.ts.map +0 -1
- package/dist/utils/v2/resolveTranslationsInObject.js.map +0 -1
- /package/dist/components/presentation/auth/AcceptInvite/{v2/AcceptInvite.d.ts → AcceptInvite.d.ts} +0 -0
- /package/dist/components/presentation/auth/AcceptInvite/{v2/BaseAcceptInvite.styles.d.ts → BaseAcceptInvite.styles.d.ts} +0 -0
- /package/dist/components/presentation/auth/InviteUser/{v2/BaseInviteUser.styles.d.ts → BaseInviteUser.styles.d.ts} +0 -0
- /package/dist/components/presentation/auth/InviteUser/{v2/InviteUser.d.ts → InviteUser.d.ts} +0 -0
- /package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.d.ts → OrganizationUnitPicker.d.ts} +0 -0
- /package/dist/components/presentation/auth/OrganizationUnitPicker/{v2/OrganizationUnitPicker.styles.d.ts → OrganizationUnitPicker.styles.d.ts} +0 -0
- /package/dist/hooks/{v2/useOAuthCallback.d.ts → useOAuthCallback.d.ts} +0 -0
- /package/dist/utils/{v2/buildThemeConfigFromFlowMeta.d.ts → buildThemeConfigFromFlowMeta.d.ts} +0 -0
- /package/dist/utils/{v2/passkey.d.ts → passkey.d.ts} +0 -0
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
import ComponentRendererContext_default from "../../../../../contexts/ComponentRenderer/ComponentRendererContext.js";
|
|
2
|
-
import FlowProvider_default from "../../../../../contexts/Flow/FlowProvider.js";
|
|
3
|
-
import useThunderID_default from "../../../../../contexts/ThunderID/useThunderID.js";
|
|
4
|
-
import useFlow_default from "../../../../../contexts/Flow/useFlow.js";
|
|
5
|
-
import useTheme_default from "../../../../../contexts/Theme/useTheme.js";
|
|
6
|
-
import ComponentPreferencesContext_default from "../../../../../contexts/I18n/ComponentPreferencesContext.js";
|
|
7
|
-
import useTranslation_default from "../../../../../hooks/useTranslation.js";
|
|
8
|
-
import { useForm } from "../../../../../hooks/useForm.js";
|
|
9
|
-
import Spinner_default from "../../../../primitives/Spinner/Spinner.js";
|
|
10
|
-
import Typography_default from "../../../../primitives/Typography/Typography.js";
|
|
11
|
-
import Alert_default from "../../../../primitives/Alert/Alert.js";
|
|
12
|
-
import Card_default from "../../../../primitives/Card/Card.js";
|
|
13
|
-
import Logo_default from "../../../../primitives/Logo/Logo.js";
|
|
14
|
-
import { extractErrorMessage, normalizeFlowResponse } from "../../../../../utils/v2/flowTransformer.js";
|
|
15
|
-
import { renderRecoveryComponents } from "../../AuthOptionFactory.js";
|
|
16
|
-
import BaseSignUp_styles_default from "../../SignUp/BaseSignUp.styles.js";
|
|
17
|
-
import getAuthComponentHeadings_default from "../../../../../utils/v2/getAuthComponentHeadings.js";
|
|
18
|
-
import { EmbeddedFlowComponentTypeV2, EmbeddedRecoveryFlowStatusV2, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
19
|
-
import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
20
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { cx } from "@emotion/css";
|
|
22
|
-
|
|
23
|
-
//#region src/components/presentation/auth/Recovery/v2/BaseRecovery.tsx
|
|
24
|
-
/**
|
|
25
|
-
* Internal component that renders the V2 recovery UI and manages flow state.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
const BaseRecoveryContent = ({ onInitialize, onSubmit, onError, onFlowChange, onComplete, error: externalError, className = "", inputClassName = "", buttonClassName = "", errorClassName = "", messageClassName = "", size = "medium", variant = "outlined", isInitialized, children, showTitle = true, showSubtitle = true }) => {
|
|
30
|
-
const { theme, colorScheme } = useTheme_default();
|
|
31
|
-
const customRenderers = useContext(ComponentRendererContext_default);
|
|
32
|
-
const { t } = useTranslation_default();
|
|
33
|
-
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
34
|
-
const { meta } = useThunderID_default();
|
|
35
|
-
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
36
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
37
|
-
const [isFlowInitialized, setIsFlowInitialized] = useState(false);
|
|
38
|
-
const [currentFlow, setCurrentFlow] = useState(null);
|
|
39
|
-
const [apiError, setApiError] = useState(null);
|
|
40
|
-
const initializationAttemptedRef = useRef(false);
|
|
41
|
-
const challengeTokenRef = useRef(null);
|
|
42
|
-
const handleError = useCallback((error) => {
|
|
43
|
-
const errorMessage = extractErrorMessage(error, t);
|
|
44
|
-
setApiError(error instanceof Error ? error : new Error(errorMessage));
|
|
45
|
-
clearMessages();
|
|
46
|
-
addMessage({
|
|
47
|
-
message: errorMessage,
|
|
48
|
-
type: "error"
|
|
49
|
-
});
|
|
50
|
-
}, [
|
|
51
|
-
t,
|
|
52
|
-
addMessage,
|
|
53
|
-
clearMessages
|
|
54
|
-
]);
|
|
55
|
-
const normalizeFlowResponseLocal = useCallback((response) => {
|
|
56
|
-
if (response?.data?.components && Array.isArray(response.data.components)) return response;
|
|
57
|
-
if (response?.data) {
|
|
58
|
-
const { components } = normalizeFlowResponse(response, t, {
|
|
59
|
-
defaultErrorKey: "components.recovery.errors.generic",
|
|
60
|
-
resolveTranslations: false
|
|
61
|
-
}, meta);
|
|
62
|
-
return {
|
|
63
|
-
...response,
|
|
64
|
-
data: {
|
|
65
|
-
...response.data,
|
|
66
|
-
components
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return response;
|
|
71
|
-
}, [t, meta]);
|
|
72
|
-
const extractFormFields = useCallback((components) => {
|
|
73
|
-
const fields = [];
|
|
74
|
-
const processComponents = (comps) => {
|
|
75
|
-
comps.forEach((component) => {
|
|
76
|
-
if (component.type === EmbeddedFlowComponentTypeV2.TextInput || component.type === EmbeddedFlowComponentTypeV2.PasswordInput || component.type === EmbeddedFlowComponentTypeV2.EmailInput || component.type === EmbeddedFlowComponentTypeV2.Select) {
|
|
77
|
-
const fieldName = component.ref || component.id;
|
|
78
|
-
fields.push({
|
|
79
|
-
initialValue: "",
|
|
80
|
-
name: fieldName,
|
|
81
|
-
required: component.required || false,
|
|
82
|
-
validator: (value) => {
|
|
83
|
-
if (component.required && (!value || value.trim() === "")) return t("validations.required.field.error");
|
|
84
|
-
if ((component.type === EmbeddedFlowComponentTypeV2.EmailInput || component.variant === "EMAIL") && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) return t("field.email.invalid");
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
if (component.components && Array.isArray(component.components)) processComponents(component.components);
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
processComponents(components);
|
|
93
|
-
return fields;
|
|
94
|
-
}, [t]);
|
|
95
|
-
const { values: formValues, touched: touchedFields, errors: formErrors, isValid: isFormValid, setValue: setFormValue, setTouched: setFormTouched, validateForm, touchAllFields, reset: resetForm } = useForm({
|
|
96
|
-
fields: currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [],
|
|
97
|
-
initialValues: {},
|
|
98
|
-
requiredMessage: t("validations.required.field.error"),
|
|
99
|
-
validateOnBlur: true,
|
|
100
|
-
validateOnChange: false
|
|
101
|
-
});
|
|
102
|
-
const setupFormFields = useCallback((flowResponse) => {
|
|
103
|
-
const fields = extractFormFields(flowResponse.data?.components || []);
|
|
104
|
-
const initialValues = {};
|
|
105
|
-
fields.forEach((field) => {
|
|
106
|
-
initialValues[field.name] = field.initialValue || "";
|
|
107
|
-
});
|
|
108
|
-
resetForm();
|
|
109
|
-
Object.keys(initialValues).forEach((key) => setFormValue(key, initialValues[key]));
|
|
110
|
-
}, [
|
|
111
|
-
extractFormFields,
|
|
112
|
-
resetForm,
|
|
113
|
-
setFormValue
|
|
114
|
-
]);
|
|
115
|
-
const handleInputChange = (name, value) => {
|
|
116
|
-
setFormValue(name, value);
|
|
117
|
-
};
|
|
118
|
-
const handleInputBlur = (name) => {
|
|
119
|
-
setFormTouched(name, true);
|
|
120
|
-
};
|
|
121
|
-
const handleSubmit = async (component, data, skipValidation) => {
|
|
122
|
-
if (!currentFlow) return;
|
|
123
|
-
if (!skipValidation) {
|
|
124
|
-
touchAllFields();
|
|
125
|
-
if (!validateForm().isValid) return;
|
|
126
|
-
}
|
|
127
|
-
setIsLoading(true);
|
|
128
|
-
setApiError(null);
|
|
129
|
-
clearMessages();
|
|
130
|
-
try {
|
|
131
|
-
const filteredInputs = {};
|
|
132
|
-
if (data) Object.entries(data).forEach(([key, value]) => {
|
|
133
|
-
if (value !== null && value !== void 0 && value !== "") filteredInputs[key] = value;
|
|
134
|
-
});
|
|
135
|
-
const payload = {
|
|
136
|
-
...currentFlow.executionId && { executionId: currentFlow.executionId },
|
|
137
|
-
...component.id && { action: component.id },
|
|
138
|
-
...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {},
|
|
139
|
-
inputs: filteredInputs
|
|
140
|
-
};
|
|
141
|
-
const rawResponse = await onSubmit?.(payload);
|
|
142
|
-
if (!rawResponse) return;
|
|
143
|
-
const response = normalizeFlowResponseLocal(rawResponse);
|
|
144
|
-
onFlowChange?.(response);
|
|
145
|
-
if (response.challengeToken !== void 0) challengeTokenRef.current = response.challengeToken ?? null;
|
|
146
|
-
if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Error) {
|
|
147
|
-
handleError(response);
|
|
148
|
-
onError?.(new Error(extractErrorMessage(response, t)));
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Complete) {
|
|
152
|
-
onComplete?.(response);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Incomplete) {
|
|
156
|
-
setCurrentFlow(response);
|
|
157
|
-
setupFormFields(response);
|
|
158
|
-
if (response?.error) handleError(response);
|
|
159
|
-
}
|
|
160
|
-
} catch (err) {
|
|
161
|
-
handleError(err);
|
|
162
|
-
onError?.(err);
|
|
163
|
-
} finally {
|
|
164
|
-
setIsLoading(false);
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
const containerClasses = cx([
|
|
168
|
-
withVendorCSSClassPrefix("recovery"),
|
|
169
|
-
withVendorCSSClassPrefix(`recovery--${size}`),
|
|
170
|
-
withVendorCSSClassPrefix(`recovery--${variant}`)
|
|
171
|
-
], className);
|
|
172
|
-
const inputClasses = cx([
|
|
173
|
-
withVendorCSSClassPrefix("recovery__input"),
|
|
174
|
-
size === "small" && withVendorCSSClassPrefix("recovery__input--small"),
|
|
175
|
-
size === "large" && withVendorCSSClassPrefix("recovery__input--large")
|
|
176
|
-
], inputClassName);
|
|
177
|
-
const buttonClasses = cx([
|
|
178
|
-
withVendorCSSClassPrefix("recovery__button"),
|
|
179
|
-
size === "small" && withVendorCSSClassPrefix("recovery__button--small"),
|
|
180
|
-
size === "large" && withVendorCSSClassPrefix("recovery__button--large")
|
|
181
|
-
], buttonClassName);
|
|
182
|
-
const errorClasses = cx([withVendorCSSClassPrefix("recovery__error")], errorClassName);
|
|
183
|
-
const messageClasses = cx([withVendorCSSClassPrefix("recovery__messages")], messageClassName);
|
|
184
|
-
const renderComponents = useCallback((components) => renderRecoveryComponents(components, formValues, touchedFields, formErrors, isLoading, isFormValid, handleInputChange, {
|
|
185
|
-
_customRenderers: customRenderers,
|
|
186
|
-
_theme: theme,
|
|
187
|
-
buttonClassName: buttonClasses,
|
|
188
|
-
inputClassName: inputClasses,
|
|
189
|
-
meta,
|
|
190
|
-
onInputBlur: handleInputBlur,
|
|
191
|
-
onSubmit: handleSubmit,
|
|
192
|
-
size,
|
|
193
|
-
variant
|
|
194
|
-
}), [
|
|
195
|
-
customRenderers,
|
|
196
|
-
buttonClasses,
|
|
197
|
-
formErrors,
|
|
198
|
-
formValues,
|
|
199
|
-
handleInputBlur,
|
|
200
|
-
handleSubmit,
|
|
201
|
-
inputClasses,
|
|
202
|
-
isFormValid,
|
|
203
|
-
meta,
|
|
204
|
-
isLoading,
|
|
205
|
-
size,
|
|
206
|
-
theme,
|
|
207
|
-
touchedFields,
|
|
208
|
-
variant
|
|
209
|
-
]);
|
|
210
|
-
useEffect(() => {
|
|
211
|
-
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
212
|
-
initializationAttemptedRef.current = true;
|
|
213
|
-
(async () => {
|
|
214
|
-
setIsLoading(true);
|
|
215
|
-
setApiError(null);
|
|
216
|
-
clearMessages();
|
|
217
|
-
try {
|
|
218
|
-
const rawResponse = await onInitialize?.();
|
|
219
|
-
if (!rawResponse) return;
|
|
220
|
-
const response = normalizeFlowResponseLocal(rawResponse);
|
|
221
|
-
if (response.challengeToken !== void 0) challengeTokenRef.current = response.challengeToken ?? null;
|
|
222
|
-
if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Error) {
|
|
223
|
-
handleError(response);
|
|
224
|
-
onError?.(new Error(extractErrorMessage(response, t)));
|
|
225
|
-
}
|
|
226
|
-
setCurrentFlow(response);
|
|
227
|
-
setIsFlowInitialized(true);
|
|
228
|
-
onFlowChange?.(response);
|
|
229
|
-
if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Complete) {
|
|
230
|
-
onComplete?.(response);
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Incomplete) {
|
|
234
|
-
setupFormFields(response);
|
|
235
|
-
if (response?.error) handleError(response);
|
|
236
|
-
}
|
|
237
|
-
} catch (err) {
|
|
238
|
-
handleError(err);
|
|
239
|
-
onError?.(err);
|
|
240
|
-
} finally {
|
|
241
|
-
setIsLoading(false);
|
|
242
|
-
}
|
|
243
|
-
})();
|
|
244
|
-
}
|
|
245
|
-
}, [
|
|
246
|
-
isFlowInitialized,
|
|
247
|
-
isInitialized,
|
|
248
|
-
normalizeFlowResponseLocal,
|
|
249
|
-
onComplete,
|
|
250
|
-
onError,
|
|
251
|
-
onFlowChange,
|
|
252
|
-
onInitialize,
|
|
253
|
-
setupFormFields,
|
|
254
|
-
t
|
|
255
|
-
]);
|
|
256
|
-
if (children) {
|
|
257
|
-
if (typeof children === "function") return /* @__PURE__ */ jsx("div", {
|
|
258
|
-
className: containerClasses,
|
|
259
|
-
children: children({
|
|
260
|
-
components: currentFlow?.data?.components || [],
|
|
261
|
-
error: apiError,
|
|
262
|
-
fieldErrors: formErrors,
|
|
263
|
-
handleInputChange,
|
|
264
|
-
handleSubmit,
|
|
265
|
-
isLoading,
|
|
266
|
-
isValid: isFormValid,
|
|
267
|
-
messages: flowMessages || [],
|
|
268
|
-
meta,
|
|
269
|
-
subtitle: flowSubtitle || t("recovery.subheading"),
|
|
270
|
-
title: flowTitle || t("recovery.heading"),
|
|
271
|
-
touched: touchedFields,
|
|
272
|
-
validateForm: () => {
|
|
273
|
-
const result = validateForm();
|
|
274
|
-
return {
|
|
275
|
-
fieldErrors: result.errors,
|
|
276
|
-
isValid: result.isValid
|
|
277
|
-
};
|
|
278
|
-
},
|
|
279
|
-
values: formValues
|
|
280
|
-
})
|
|
281
|
-
});
|
|
282
|
-
return /* @__PURE__ */ jsx("div", {
|
|
283
|
-
className: containerClasses,
|
|
284
|
-
children
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
if (!isFlowInitialized && isLoading) return /* @__PURE__ */ jsx(Card_default, {
|
|
288
|
-
className: cx(containerClasses, styles.card),
|
|
289
|
-
variant,
|
|
290
|
-
children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsx("div", {
|
|
291
|
-
className: styles.loadingContainer,
|
|
292
|
-
children: /* @__PURE__ */ jsx(Spinner_default, { size: "medium" })
|
|
293
|
-
}) })
|
|
294
|
-
});
|
|
295
|
-
if (!currentFlow) return /* @__PURE__ */ jsx(Card_default, {
|
|
296
|
-
className: cx(containerClasses, styles.card),
|
|
297
|
-
variant,
|
|
298
|
-
children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsxs(Alert_default, {
|
|
299
|
-
variant: "error",
|
|
300
|
-
className: errorClasses,
|
|
301
|
-
children: [/* @__PURE__ */ jsx(Alert_default.Title, { children: t("errors.heading") }), /* @__PURE__ */ jsx(Alert_default.Description, { children: t("errors.recovery.flow.initialization.failure") })]
|
|
302
|
-
}) })
|
|
303
|
-
});
|
|
304
|
-
const { title, subtitle, componentsWithoutHeadings } = getAuthComponentHeadings_default(currentFlow.data?.components || [], flowTitle, flowSubtitle, t("recovery.heading"), t("recovery.subheading"));
|
|
305
|
-
return /* @__PURE__ */ jsxs(Card_default, {
|
|
306
|
-
className: cx(containerClasses, styles.card),
|
|
307
|
-
variant,
|
|
308
|
-
children: [(showTitle || showSubtitle) && /* @__PURE__ */ jsxs(Card_default.Header, {
|
|
309
|
-
className: styles.header,
|
|
310
|
-
children: [showTitle && /* @__PURE__ */ jsx(Card_default.Title, {
|
|
311
|
-
level: 2,
|
|
312
|
-
className: styles.title,
|
|
313
|
-
children: title
|
|
314
|
-
}), showSubtitle && /* @__PURE__ */ jsx(Typography_default, {
|
|
315
|
-
variant: "body1",
|
|
316
|
-
className: styles.subtitle,
|
|
317
|
-
children: subtitle
|
|
318
|
-
})]
|
|
319
|
-
}), /* @__PURE__ */ jsxs(Card_default.Content, { children: [
|
|
320
|
-
externalError && /* @__PURE__ */ jsx("div", {
|
|
321
|
-
className: styles.flowMessagesContainer,
|
|
322
|
-
children: /* @__PURE__ */ jsx(Alert_default, {
|
|
323
|
-
variant: "error",
|
|
324
|
-
className: cx(styles.flowMessageItem, messageClasses),
|
|
325
|
-
children: /* @__PURE__ */ jsx(Alert_default.Description, { children: externalError.message })
|
|
326
|
-
})
|
|
327
|
-
}),
|
|
328
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
329
|
-
className: styles.flowMessagesContainer,
|
|
330
|
-
children: flowMessages.map((message, index) => /* @__PURE__ */ jsx(Alert_default, {
|
|
331
|
-
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
332
|
-
className: cx(styles.flowMessageItem, messageClasses),
|
|
333
|
-
children: /* @__PURE__ */ jsx(Alert_default.Description, { children: message.message })
|
|
334
|
-
}, message.id || index))
|
|
335
|
-
}),
|
|
336
|
-
/* @__PURE__ */ jsx("div", {
|
|
337
|
-
className: styles.contentContainer,
|
|
338
|
-
children: componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : /* @__PURE__ */ jsx(Alert_default, {
|
|
339
|
-
variant: "warning",
|
|
340
|
-
children: /* @__PURE__ */ jsx(Typography_default, {
|
|
341
|
-
variant: "body1",
|
|
342
|
-
children: t("errors.recovery.components.not.available")
|
|
343
|
-
})
|
|
344
|
-
})
|
|
345
|
-
})
|
|
346
|
-
] })]
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
/**
|
|
350
|
-
* BaseRecovery component for ThunderIDV2 that provides an embedded account/password recovery flow.
|
|
351
|
-
* Accepts API functions as props to maintain framework independence.
|
|
352
|
-
*/
|
|
353
|
-
const BaseRecovery = ({ preferences, showLogo = true,...rest }) => {
|
|
354
|
-
const { theme, colorScheme } = useTheme_default();
|
|
355
|
-
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
356
|
-
const content = /* @__PURE__ */ jsxs("div", { children: [showLogo && /* @__PURE__ */ jsx("div", {
|
|
357
|
-
className: styles.logoContainer,
|
|
358
|
-
children: /* @__PURE__ */ jsx(Logo_default, { size: "large" })
|
|
359
|
-
}), /* @__PURE__ */ jsx(FlowProvider_default, { children: /* @__PURE__ */ jsx(BaseRecoveryContent, {
|
|
360
|
-
showLogo,
|
|
361
|
-
...rest
|
|
362
|
-
}) })] });
|
|
363
|
-
if (!preferences) return content;
|
|
364
|
-
return /* @__PURE__ */ jsx(ComponentPreferencesContext_default.Provider, {
|
|
365
|
-
value: preferences,
|
|
366
|
-
children: content
|
|
367
|
-
});
|
|
368
|
-
};
|
|
369
|
-
var BaseRecovery_default = BaseRecovery;
|
|
370
|
-
|
|
371
|
-
//#endregion
|
|
372
|
-
export { BaseRecovery_default as default };
|
|
373
|
-
//# sourceMappingURL=BaseRecovery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseRecovery.js","names":["BaseRecoveryContent: FC<BaseRecoveryProps>","useTheme","customRenderers: ComponentRendererMap","ComponentRendererContext","useTranslation","useFlow","useThunderID","styles: any","useStyles","initializationAttemptedRef: any","challengeTokenRef: any","handleError: any","errorMessage: string","normalizeFlowResponseLocal: any","extractFormFields: any","fields: FormField[]","EmbeddedFlowComponentType","fieldName: any","setupFormFields: any","fields: any","initialValues: Record<string, string>","filteredInputs: Record<string, any>","payload: EmbeddedRecoveryFlowRequestV2","rawResponse: any","response: any","containerClasses: any","inputClasses: any","buttonClasses: any","errorClasses: any","messageClasses: any","renderComponents: any","result: ReturnType<typeof validateForm>","CardPrimitive","Spinner","AlertPrimitive","getAuthComponentHeadings","Typography","BaseRecovery: FC<BaseRecoveryProps>","content: ReactElement","Logo","FlowProvider","ComponentPreferencesContext"],"sources":["../../../../../../src/components/presentation/auth/Recovery/v2/BaseRecovery.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {cx} from '@emotion/css';\nimport {\n EmbeddedRecoveryFlowRequestV2,\n EmbeddedRecoveryFlowResponseV2,\n EmbeddedRecoveryFlowStatusV2,\n EmbeddedFlowComponentTypeV2 as EmbeddedFlowComponentType,\n withVendorCSSClassPrefix,\n Preferences,\n FlowMetadataResponse,\n} from '@thunderid/browser';\nimport {FC, ReactElement, ReactNode, useContext, useEffect, useState, useCallback, useRef} from 'react';\nimport ComponentRendererContext, {\n ComponentRendererMap,\n} from '../../../../../contexts/ComponentRenderer/ComponentRendererContext';\nimport FlowProvider from '../../../../../contexts/Flow/FlowProvider';\nimport useFlow from '../../../../../contexts/Flow/useFlow';\nimport ComponentPreferencesContext from '../../../../../contexts/I18n/ComponentPreferencesContext';\nimport useTheme from '../../../../../contexts/Theme/useTheme';\nimport useThunderID from '../../../../../contexts/ThunderID/useThunderID';\nimport {useForm, FormField} from '../../../../../hooks/useForm';\nimport useTranslation from '../../../../../hooks/useTranslation';\nimport {normalizeFlowResponse, extractErrorMessage} from '../../../../../utils/v2/flowTransformer';\nimport getAuthComponentHeadings from '../../../../../utils/v2/getAuthComponentHeadings';\nimport AlertPrimitive from '../../../../primitives/Alert/Alert';\nimport CardPrimitive, {CardProps} from '../../../../primitives/Card/Card';\nimport Logo from '../../../../primitives/Logo/Logo';\nimport Spinner from '../../../../primitives/Spinner/Spinner';\nimport Typography from '../../../../primitives/Typography/Typography';\nimport {renderRecoveryComponents} from '../../AuthOptionFactory';\nimport useStyles from '../../SignUp/BaseSignUp.styles';\n\n/**\n * Render props for custom UI rendering.\n */\nexport interface BaseRecoveryRenderProps {\n components: any[];\n error?: Error | null;\n fieldErrors: Record<string, string>;\n handleInputChange: (name: string, value: string) => void;\n handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;\n isLoading: boolean;\n isValid: boolean;\n messages: {message: string; type: string}[];\n meta: FlowMetadataResponse | null;\n subtitle: string;\n title: string;\n touched: Record<string, boolean>;\n validateForm: () => {fieldErrors: Record<string, string>; isValid: boolean};\n values: Record<string, string>;\n}\n\n/**\n * Props for the BaseRecovery component.\n */\nexport interface BaseRecoveryProps {\n afterRecoveryUrl?: string;\n buttonClassName?: string;\n /**\n * Render props function for custom UI or static content\n */\n children?: ((props: BaseRecoveryRenderProps) => ReactNode) | ReactNode;\n className?: string;\n error?: Error | null;\n errorClassName?: string;\n inputClassName?: string;\n isInitialized?: boolean;\n messageClassName?: string;\n onComplete?: (response: EmbeddedRecoveryFlowResponseV2) => void;\n onError?: (error: Error) => void;\n onFlowChange?: (response: EmbeddedRecoveryFlowResponseV2) => void;\n onInitialize?: (payload?: EmbeddedRecoveryFlowRequestV2) => Promise<EmbeddedRecoveryFlowResponseV2>;\n onSubmit?: (payload: EmbeddedRecoveryFlowRequestV2) => Promise<EmbeddedRecoveryFlowResponseV2>;\n /**\n * Component-level preferences to override global i18n and theme settings.\n */\n preferences?: Preferences;\n showLogo?: boolean;\n showSubtitle?: boolean;\n showTitle?: boolean;\n size?: 'small' | 'medium' | 'large';\n variant?: CardProps['variant'];\n}\n\n/**\n * Internal component that renders the V2 recovery UI and manages flow state.\n *\n * @internal\n */\nconst BaseRecoveryContent: FC<BaseRecoveryProps> = ({\n onInitialize,\n onSubmit,\n onError,\n onFlowChange,\n onComplete,\n error: externalError,\n className = '',\n inputClassName = '',\n buttonClassName = '',\n errorClassName = '',\n messageClassName = '',\n size = 'medium',\n variant = 'outlined',\n isInitialized,\n children,\n showTitle = true,\n showSubtitle = true,\n}: BaseRecoveryProps): ReactElement => {\n const {theme, colorScheme} = useTheme();\n const customRenderers: ComponentRendererMap = useContext(ComponentRendererContext);\n const {t} = useTranslation();\n const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages} = useFlow();\n const {meta} = useThunderID();\n const styles: any = useStyles(theme, colorScheme);\n\n const [isLoading, setIsLoading] = useState(false);\n const [isFlowInitialized, setIsFlowInitialized] = useState(false);\n const [currentFlow, setCurrentFlow] = useState<EmbeddedRecoveryFlowResponseV2 | null>(null);\n const [apiError, setApiError] = useState<Error | null>(null);\n\n const initializationAttemptedRef: any = useRef(false);\n const challengeTokenRef: any = useRef<string | null>(null);\n\n const handleError: any = useCallback(\n (error: any) => {\n const errorMessage: string = extractErrorMessage(error, t);\n setApiError(error instanceof Error ? error : new Error(errorMessage));\n clearMessages();\n addMessage({message: errorMessage, type: 'error'});\n },\n [t, addMessage, clearMessages],\n );\n\n const normalizeFlowResponseLocal: any = useCallback(\n (response: EmbeddedRecoveryFlowResponseV2): EmbeddedRecoveryFlowResponseV2 => {\n if (response?.data?.components && Array.isArray(response.data.components)) {\n return response;\n }\n\n if (response?.data) {\n const {components} = normalizeFlowResponse(\n response,\n t,\n {defaultErrorKey: 'components.recovery.errors.generic', resolveTranslations: false},\n meta,\n );\n\n return {...response, data: {...response.data, components: components as any}};\n }\n\n return response;\n },\n [t, meta],\n );\n\n const extractFormFields: any = useCallback(\n (components: any[]): FormField[] => {\n const fields: FormField[] = [];\n\n const processComponents = (comps: any[]): any => {\n comps.forEach((component: any) => {\n if (\n component.type === EmbeddedFlowComponentType.TextInput ||\n component.type === EmbeddedFlowComponentType.PasswordInput ||\n component.type === EmbeddedFlowComponentType.EmailInput ||\n component.type === EmbeddedFlowComponentType.Select\n ) {\n const fieldName: any = component.ref || component.id;\n fields.push({\n initialValue: '',\n name: fieldName,\n required: component.required || false,\n validator: (value: string) => {\n if (component.required && (!value || value.trim() === '')) {\n return t('validations.required.field.error');\n }\n if (\n (component.type === EmbeddedFlowComponentType.EmailInput || component.variant === 'EMAIL') &&\n value &&\n !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)\n ) {\n return t('field.email.invalid');\n }\n return null;\n },\n });\n }\n\n if (component.components && Array.isArray(component.components)) {\n processComponents(component.components);\n }\n });\n };\n\n processComponents(components);\n return fields;\n },\n [t],\n );\n\n const formFields: any = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];\n\n const form: any = useForm<Record<string, string>>({\n fields: formFields,\n initialValues: {},\n requiredMessage: t('validations.required.field.error'),\n validateOnBlur: true,\n validateOnChange: false,\n });\n\n const {\n values: formValues,\n touched: touchedFields,\n errors: formErrors,\n isValid: isFormValid,\n setValue: setFormValue,\n setTouched: setFormTouched,\n validateForm,\n touchAllFields,\n reset: resetForm,\n } = form;\n\n const setupFormFields: any = useCallback(\n (flowResponse: EmbeddedRecoveryFlowResponseV2) => {\n const fields: any = extractFormFields(flowResponse.data?.components || []);\n const initialValues: Record<string, string> = {};\n fields.forEach((field: any) => {\n initialValues[field.name] = field.initialValue || '';\n });\n resetForm();\n Object.keys(initialValues).forEach((key: any) => setFormValue(key, initialValues[key]));\n },\n [extractFormFields, resetForm, setFormValue],\n );\n\n const handleInputChange = (name: string, value: string): void => {\n setFormValue(name, value);\n };\n\n const handleInputBlur = (name: string): void => {\n setFormTouched(name, true);\n };\n\n const handleSubmit = async (component: any, data?: Record<string, any>, skipValidation?: boolean): Promise<void> => {\n if (!currentFlow) return;\n\n if (!skipValidation) {\n touchAllFields();\n const validation: ReturnType<typeof validateForm> = validateForm();\n if (!validation.isValid) return;\n }\n\n setIsLoading(true);\n setApiError(null);\n clearMessages();\n\n try {\n const filteredInputs: Record<string, any> = {};\n if (data) {\n Object.entries(data).forEach(([key, value]: [string, any]) => {\n if (value !== null && value !== undefined && value !== '') {\n filteredInputs[key] = value;\n }\n });\n }\n\n const payload: EmbeddedRecoveryFlowRequestV2 = {\n ...(currentFlow.executionId && {executionId: currentFlow.executionId}),\n ...(component.id && {action: component.id}),\n ...(challengeTokenRef.current ? {challengeToken: challengeTokenRef.current} : {}),\n inputs: filteredInputs,\n };\n\n const rawResponse: any = await onSubmit?.(payload);\n if (!rawResponse) return;\n const response: any = normalizeFlowResponseLocal(rawResponse);\n onFlowChange?.(response);\n\n if (response.challengeToken !== undefined) {\n challengeTokenRef.current = response.challengeToken ?? null;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Error) {\n handleError(response);\n onError?.(new Error(extractErrorMessage(response, t)));\n return;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Complete) {\n onComplete?.(response);\n return;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Incomplete) {\n setCurrentFlow(response);\n setupFormFields(response);\n\n // Display error from INCOMPLETE response\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (response?.error) {\n handleError(response);\n }\n }\n } catch (err) {\n handleError(err);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const containerClasses: any = cx(\n [\n withVendorCSSClassPrefix('recovery'),\n withVendorCSSClassPrefix(`recovery--${size}`),\n withVendorCSSClassPrefix(`recovery--${variant}`),\n ],\n className,\n );\n\n const inputClasses: any = cx(\n [\n withVendorCSSClassPrefix('recovery__input'),\n size === 'small' && withVendorCSSClassPrefix('recovery__input--small'),\n size === 'large' && withVendorCSSClassPrefix('recovery__input--large'),\n ],\n inputClassName,\n );\n\n const buttonClasses: any = cx(\n [\n withVendorCSSClassPrefix('recovery__button'),\n size === 'small' && withVendorCSSClassPrefix('recovery__button--small'),\n size === 'large' && withVendorCSSClassPrefix('recovery__button--large'),\n ],\n buttonClassName,\n );\n\n const errorClasses: any = cx([withVendorCSSClassPrefix('recovery__error')], errorClassName);\n const messageClasses: any = cx([withVendorCSSClassPrefix('recovery__messages')], messageClassName);\n\n const renderComponents: any = useCallback(\n (components: any[]): ReactElement[] =>\n renderRecoveryComponents(\n components,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n handleInputChange,\n {\n _customRenderers: customRenderers,\n _theme: theme,\n buttonClassName: buttonClasses,\n inputClassName: inputClasses,\n meta,\n onInputBlur: handleInputBlur,\n onSubmit: handleSubmit,\n size,\n variant,\n },\n ),\n [\n customRenderers,\n buttonClasses,\n formErrors,\n formValues,\n handleInputBlur,\n handleSubmit,\n inputClasses,\n isFormValid,\n meta,\n isLoading,\n size,\n theme,\n touchedFields,\n variant,\n ],\n );\n\n useEffect(() => {\n if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {\n initializationAttemptedRef.current = true;\n\n (async (): Promise<void> => {\n setIsLoading(true);\n setApiError(null);\n clearMessages();\n\n try {\n const rawResponse: any = await onInitialize?.();\n if (!rawResponse) return;\n const response: any = normalizeFlowResponseLocal(rawResponse);\n\n if (response.challengeToken !== undefined) {\n challengeTokenRef.current = response.challengeToken ?? null;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Error) {\n handleError(response);\n onError?.(new Error(extractErrorMessage(response, t)));\n }\n\n setCurrentFlow(response);\n setIsFlowInitialized(true);\n onFlowChange?.(response);\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Complete) {\n onComplete?.(response);\n return;\n }\n\n if (response.flowStatus === EmbeddedRecoveryFlowStatusV2.Incomplete) {\n setupFormFields(response);\n\n // Display error from INCOMPLETE response\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (response?.error) {\n handleError(response);\n }\n }\n } catch (err) {\n handleError(err);\n onError?.(err as Error);\n } finally {\n setIsLoading(false);\n }\n })();\n }\n }, [\n isFlowInitialized,\n isInitialized,\n normalizeFlowResponseLocal,\n onComplete,\n onError,\n onFlowChange,\n onInitialize,\n setupFormFields,\n t,\n ]);\n\n if (children) {\n if (typeof children === 'function') {\n const renderProps: BaseRecoveryRenderProps = {\n components: currentFlow?.data?.components || [],\n error: apiError,\n fieldErrors: formErrors,\n handleInputChange,\n handleSubmit,\n isLoading,\n isValid: isFormValid,\n messages: flowMessages || [],\n meta,\n subtitle: flowSubtitle || t('recovery.subheading'),\n title: flowTitle || t('recovery.heading'),\n touched: touchedFields,\n validateForm: (): {fieldErrors: Record<string, string>; isValid: boolean} => {\n const result: ReturnType<typeof validateForm> = validateForm();\n return {fieldErrors: result.errors, isValid: result.isValid};\n },\n values: formValues,\n };\n\n return <div className={containerClasses}>{(children as any)(renderProps)}</div>;\n }\n\n return <div className={containerClasses}>{children}</div>;\n }\n\n if (!isFlowInitialized && isLoading) {\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} variant={variant}>\n <CardPrimitive.Content>\n <div className={styles.loadingContainer}>\n <Spinner size=\"medium\" />\n </div>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n }\n\n if (!currentFlow) {\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} variant={variant}>\n <CardPrimitive.Content>\n <AlertPrimitive variant=\"error\" className={errorClasses}>\n <AlertPrimitive.Title>{t('errors.heading')}</AlertPrimitive.Title>\n <AlertPrimitive.Description>{t('errors.recovery.flow.initialization.failure')}</AlertPrimitive.Description>\n </AlertPrimitive>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n }\n\n const componentsToRender: any = currentFlow.data?.components || [];\n const {title, subtitle, componentsWithoutHeadings} = getAuthComponentHeadings(\n componentsToRender,\n flowTitle,\n flowSubtitle,\n t('recovery.heading'),\n t('recovery.subheading'),\n );\n\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} variant={variant}>\n {(showTitle || showSubtitle) && (\n <CardPrimitive.Header className={styles.header}>\n {showTitle && (\n <CardPrimitive.Title level={2} className={styles.title}>\n {title}\n </CardPrimitive.Title>\n )}\n {showSubtitle && (\n <Typography variant=\"body1\" className={styles.subtitle}>\n {subtitle}\n </Typography>\n )}\n </CardPrimitive.Header>\n )}\n <CardPrimitive.Content>\n {externalError && (\n <div className={styles.flowMessagesContainer}>\n <AlertPrimitive variant=\"error\" className={cx(styles.flowMessageItem, messageClasses)}>\n <AlertPrimitive.Description>{externalError.message}</AlertPrimitive.Description>\n </AlertPrimitive>\n </div>\n )}\n {flowMessages && flowMessages.length > 0 && (\n <div className={styles.flowMessagesContainer}>\n {flowMessages.map((message: any, index: number) => (\n <AlertPrimitive\n key={message.id || index}\n variant={message.type?.toLowerCase() === 'error' ? 'error' : 'info'}\n className={cx(styles.flowMessageItem, messageClasses)}\n >\n <AlertPrimitive.Description>{message.message}</AlertPrimitive.Description>\n </AlertPrimitive>\n ))}\n </div>\n )}\n <div className={styles.contentContainer}>\n {componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? (\n renderComponents(componentsWithoutHeadings)\n ) : (\n <AlertPrimitive variant=\"warning\">\n <Typography variant=\"body1\">{t('errors.recovery.components.not.available')}</Typography>\n </AlertPrimitive>\n )}\n </div>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n};\n\n/**\n * BaseRecovery component for ThunderIDV2 that provides an embedded account/password recovery flow.\n * Accepts API functions as props to maintain framework independence.\n */\nconst BaseRecovery: FC<BaseRecoveryProps> = ({\n preferences,\n showLogo = true,\n ...rest\n}: BaseRecoveryProps): ReactElement => {\n const {theme, colorScheme} = useTheme();\n const styles: any = useStyles(theme, colorScheme);\n\n const content: ReactElement = (\n <div>\n {showLogo && (\n <div className={styles.logoContainer}>\n <Logo size=\"large\" />\n </div>\n )}\n <FlowProvider>\n <BaseRecoveryContent showLogo={showLogo} {...rest} />\n </FlowProvider>\n </div>\n );\n\n if (!preferences) return content;\n\n return <ComponentPreferencesContext.Provider value={preferences}>{content}</ComponentPreferencesContext.Provider>;\n};\n\nexport default BaseRecovery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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AQpB,MAAMC,gBAAuC,EAC3C,aACA,WAAW,KACX,GAAG,WACkC;CACrC,MAAM,EAAC,OAAO,gBAAepC,kBAAU;CACvC,MAAMM,SAAcC,0BAAU,OAAO,YAAY;CAEjD,MAAM8B,UACJ,qBAAC,oBACE,YACC,oBAAC;EAAI,WAAW,OAAO;YACrB,oBAACC,gBAAK,MAAK,UAAU;GACjB,EAER,oBAACC,kCACC,oBAAC;EAA8B;EAAU,GAAI;GAAQ,GACxC,IACX;AAGR,KAAI,CAAC,YAAa,QAAO;AAEzB,QAAO,oBAACC,oCAA4B;EAAS,OAAO;YAAc;GAA+C;;AAGnH,2BAAe"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
-
*
|
|
4
|
-
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
import { FC, PropsWithChildren } from 'react';
|
|
19
|
-
import { BaseRecoveryProps } from './BaseRecovery';
|
|
20
|
-
export type RecoveryProps = PropsWithChildren<BaseRecoveryProps & {
|
|
21
|
-
/**
|
|
22
|
-
* URL query parameter name that carries the recovery token when the user lands via a recovery link.
|
|
23
|
-
* When set and both `executionId` and this param are present in the URL, the component resumes the
|
|
24
|
-
* existing flow instead of starting a new one.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* // For a link like /recovery?executionId=xxx&recoveryToken=yyy
|
|
28
|
-
* <Recovery tokenUrlParam="recoveryToken" />
|
|
29
|
-
*/
|
|
30
|
-
tokenUrlParam?: string;
|
|
31
|
-
}>;
|
|
32
|
-
/**
|
|
33
|
-
* Recovery component for ThunderIDV2 that provides an embedded account/password recovery flow.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```tsx
|
|
37
|
-
* // Default UI
|
|
38
|
-
* <Recovery
|
|
39
|
-
* afterRecoveryUrl="/sign-in"
|
|
40
|
-
* onComplete={(response) => console.log('Recovery complete', response)}
|
|
41
|
-
* onError={(error) => console.error('Recovery failed', error)}
|
|
42
|
-
* />
|
|
43
|
-
*
|
|
44
|
-
* // Custom UI with render props
|
|
45
|
-
* <Recovery>
|
|
46
|
-
* {({ values, fieldErrors, handleInputChange, handleSubmit, isLoading, components }) => (
|
|
47
|
-
* <form onSubmit={(e) => { e.preventDefault(); handleSubmit(components[0], values); }}>
|
|
48
|
-
* ...
|
|
49
|
-
* </form>
|
|
50
|
-
* )}
|
|
51
|
-
* </Recovery>
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
declare const Recovery: FC<RecoveryProps>;
|
|
55
|
-
export default Recovery;
|
|
56
|
-
//# sourceMappingURL=Recovery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Recovery.d.ts","sourceRoot":"","sources":["../../../../../../src/components/presentation/auth/Recovery/v2/Recovery.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AACvE,OAAqB,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAG/D,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAC3C,iBAAiB,GAAG;IAClB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA4E/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import useThunderID_default from "../../../../../contexts/ThunderID/useThunderID.js";
|
|
2
|
-
import BaseRecovery_default from "./BaseRecovery.js";
|
|
3
|
-
import { EmbeddedFlowType } from "@thunderid/browser";
|
|
4
|
-
import { useCallback } from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/components/presentation/auth/Recovery/v2/Recovery.tsx
|
|
8
|
-
/**
|
|
9
|
-
* Recovery component for ThunderIDV2 that provides an embedded account/password recovery flow.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* // Default UI
|
|
14
|
-
* <Recovery
|
|
15
|
-
* afterRecoveryUrl="/sign-in"
|
|
16
|
-
* onComplete={(response) => console.log('Recovery complete', response)}
|
|
17
|
-
* onError={(error) => console.error('Recovery failed', error)}
|
|
18
|
-
* />
|
|
19
|
-
*
|
|
20
|
-
* // Custom UI with render props
|
|
21
|
-
* <Recovery>
|
|
22
|
-
* {({ values, fieldErrors, handleInputChange, handleSubmit, isLoading, components }) => (
|
|
23
|
-
* <form onSubmit={(e) => { e.preventDefault(); handleSubmit(components[0], values); }}>
|
|
24
|
-
* ...
|
|
25
|
-
* </form>
|
|
26
|
-
* )}
|
|
27
|
-
* </Recovery>
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
const Recovery = ({ className, size = "medium", afterRecoveryUrl, onError, onComplete, tokenUrlParam, children,...rest }) => {
|
|
31
|
-
const { recover, isInitialized, applicationId } = useThunderID_default();
|
|
32
|
-
return /* @__PURE__ */ jsx(BaseRecovery_default, {
|
|
33
|
-
afterRecoveryUrl,
|
|
34
|
-
onInitialize: useCallback(async (payload) => {
|
|
35
|
-
const urlParams = new URL(window.location.href).searchParams;
|
|
36
|
-
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
37
|
-
const effectiveApplicationId = applicationId ?? applicationIdFromUrl;
|
|
38
|
-
if (tokenUrlParam) {
|
|
39
|
-
const executionId = urlParams.get("executionId");
|
|
40
|
-
const tokenValue = urlParams.get(tokenUrlParam);
|
|
41
|
-
if (executionId && tokenValue) return await recover({
|
|
42
|
-
executionId,
|
|
43
|
-
inputs: { [tokenUrlParam]: tokenValue }
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return await recover(payload ?? {
|
|
47
|
-
flowType: EmbeddedFlowType.Recovery,
|
|
48
|
-
...effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
49
|
-
});
|
|
50
|
-
}, [
|
|
51
|
-
applicationId,
|
|
52
|
-
tokenUrlParam,
|
|
53
|
-
recover
|
|
54
|
-
]),
|
|
55
|
-
onSubmit: useCallback(async (payload) => await recover(payload), [recover]),
|
|
56
|
-
onError,
|
|
57
|
-
onComplete: useCallback((response) => {
|
|
58
|
-
onComplete?.(response);
|
|
59
|
-
if (afterRecoveryUrl) window.location.href = afterRecoveryUrl;
|
|
60
|
-
}, [onComplete, afterRecoveryUrl]),
|
|
61
|
-
className,
|
|
62
|
-
size,
|
|
63
|
-
isInitialized,
|
|
64
|
-
showTitle: true,
|
|
65
|
-
showSubtitle: true,
|
|
66
|
-
children,
|
|
67
|
-
...rest
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
var Recovery_default = Recovery;
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
export { Recovery_default as default };
|
|
74
|
-
//# sourceMappingURL=Recovery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Recovery.js","names":["Recovery: FC<RecoveryProps>","useThunderID","BaseRecovery","urlParams: URLSearchParams","applicationIdFromUrl: string | null","effectiveApplicationId: string | null","executionId: string | null","tokenValue: string | null"],"sources":["../../../../../../src/components/presentation/auth/Recovery/v2/Recovery.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedRecoveryFlowRequestV2, EmbeddedRecoveryFlowResponseV2, EmbeddedFlowType} from '@thunderid/browser';\nimport {FC, PropsWithChildren, ReactElement, useCallback} from 'react';\nimport BaseRecovery, {BaseRecoveryProps} from './BaseRecovery';\nimport useThunderID from '../../../../../contexts/ThunderID/useThunderID';\n\nexport type RecoveryProps = PropsWithChildren<\n BaseRecoveryProps & {\n /**\n * URL query parameter name that carries the recovery token when the user lands via a recovery link.\n * When set and both `executionId` and this param are present in the URL, the component resumes the\n * existing flow instead of starting a new one.\n *\n * @example\n * // For a link like /recovery?executionId=xxx&recoveryToken=yyy\n * <Recovery tokenUrlParam=\"recoveryToken\" />\n */\n tokenUrlParam?: string;\n }\n>;\n\n/**\n * Recovery component for ThunderIDV2 that provides an embedded account/password recovery flow.\n *\n * @example\n * ```tsx\n * // Default UI\n * <Recovery\n * afterRecoveryUrl=\"/sign-in\"\n * onComplete={(response) => console.log('Recovery complete', response)}\n * onError={(error) => console.error('Recovery failed', error)}\n * />\n *\n * // Custom UI with render props\n * <Recovery>\n * {({ values, fieldErrors, handleInputChange, handleSubmit, isLoading, components }) => (\n * <form onSubmit={(e) => { e.preventDefault(); handleSubmit(components[0], values); }}>\n * ...\n * </form>\n * )}\n * </Recovery>\n * ```\n */\nconst Recovery: FC<RecoveryProps> = ({\n className,\n size = 'medium',\n afterRecoveryUrl,\n onError,\n onComplete,\n tokenUrlParam,\n children,\n ...rest\n}: RecoveryProps): ReactElement => {\n const {recover, isInitialized, applicationId} = useThunderID();\n\n const handleInitialize: (payload?: EmbeddedRecoveryFlowRequestV2) => Promise<EmbeddedRecoveryFlowResponseV2> =\n useCallback(\n async (payload?: EmbeddedRecoveryFlowRequestV2): Promise<EmbeddedRecoveryFlowResponseV2> => {\n const urlParams: URLSearchParams = new URL(window.location.href).searchParams;\n const applicationIdFromUrl: string | null = urlParams.get('applicationId');\n const effectiveApplicationId: string | null = applicationId ?? applicationIdFromUrl;\n\n if (tokenUrlParam) {\n const executionId: string | null = urlParams.get('executionId');\n const tokenValue: string | null = urlParams.get(tokenUrlParam);\n\n if (executionId && tokenValue) {\n const resumePayload: EmbeddedRecoveryFlowRequestV2 = {\n executionId,\n inputs: {[tokenUrlParam]: tokenValue},\n };\n return (await recover(resumePayload)) as EmbeddedRecoveryFlowResponseV2;\n }\n }\n\n const initialPayload: EmbeddedRecoveryFlowRequestV2 = payload ?? {\n flowType: EmbeddedFlowType.Recovery,\n ...(effectiveApplicationId && {applicationId: effectiveApplicationId}),\n };\n\n return (await recover(initialPayload)) as EmbeddedRecoveryFlowResponseV2;\n },\n [applicationId, tokenUrlParam, recover],\n );\n\n const handleOnSubmit: (payload: EmbeddedRecoveryFlowRequestV2) => Promise<EmbeddedRecoveryFlowResponseV2> =\n useCallback(\n async (payload: EmbeddedRecoveryFlowRequestV2): Promise<EmbeddedRecoveryFlowResponseV2> =>\n (await recover(payload)) as EmbeddedRecoveryFlowResponseV2,\n [recover],\n );\n\n const handleComplete: (response: EmbeddedRecoveryFlowResponseV2) => void = useCallback(\n (response: EmbeddedRecoveryFlowResponseV2): void => {\n onComplete?.(response);\n\n if (afterRecoveryUrl) {\n window.location.href = afterRecoveryUrl;\n }\n },\n [onComplete, afterRecoveryUrl],\n );\n\n return (\n <BaseRecovery\n afterRecoveryUrl={afterRecoveryUrl}\n onInitialize={handleInitialize}\n onSubmit={handleOnSubmit}\n onError={onError}\n onComplete={handleComplete}\n className={className}\n size={size}\n isInitialized={isInitialized}\n showTitle={true}\n showSubtitle={true}\n children={children}\n {...rest}\n />\n );\n};\n\nexport default Recovery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAMA,YAA+B,EACnC,WACA,OAAO,UACP,kBACA,SACA,YACA,eACA,SACA,GAAG,WAC8B;CACjC,MAAM,EAAC,SAAS,eAAe,kBAAiBC,sBAAc;AAkD9D,QACE,oBAACC;EACmB;EAClB,cAlDF,YACE,OAAO,YAAqF;GAC1F,MAAMC,YAA6B,IAAI,IAAI,OAAO,SAAS,KAAK,CAAC;GACjE,MAAMC,uBAAsC,UAAU,IAAI,gBAAgB;GAC1E,MAAMC,yBAAwC,iBAAiB;AAE/D,OAAI,eAAe;IACjB,MAAMC,cAA6B,UAAU,IAAI,cAAc;IAC/D,MAAMC,aAA4B,UAAU,IAAI,cAAc;AAE9D,QAAI,eAAe,WAKjB,QAAQ,MAAM,QAJuC;KACnD;KACA,QAAQ,GAAE,gBAAgB,YAAW;KACtC,CACmC;;AASxC,UAAQ,MAAM,QALwC,WAAW;IAC/D,UAAU,iBAAiB;IAC3B,GAAI,0BAA0B,EAAC,eAAe,wBAAuB;IACtE,CAEoC;KAEvC;GAAC;GAAe;GAAe;GAAQ,CACxC;EAwBC,UArBF,YACE,OAAO,YACJ,MAAM,QAAQ,QAAQ,EACzB,CAAC,QAAQ,CACV;EAkBU;EACT,YAjBuE,aACxE,aAAmD;AAClD,gBAAa,SAAS;AAEtB,OAAI,iBACF,QAAO,SAAS,OAAO;KAG3B,CAAC,YAAY,iBAAiB,CAC/B;EASc;EACL;EACS;EACf,WAAW;EACX,cAAc;EACJ;EACV,GAAI;GACJ;;AAIN,uBAAe"}
|