@thunderid/react 0.2.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 -656
- 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 -651
- 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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSignIn.cjs","names":["BaseSignInContent: FC<BaseSignInProps>","useThunderID","useTheme","customRenderers: ComponentRendererMap","ComponentRendererContext","useTranslation","useFlow","styles: any","useStyles","isLoading: boolean","handleError: any","errorMessage: string","extractErrorMessage","extractFormFields: (components: EmbeddedFlowComponent[]) => FormField[]","fields: FormField[]","identifier: string","useForm","filteredInputs: Record<string, any>","payload: EmbeddedSignInFlowRequest","containerClasses: any","inputClasses: any","buttonClasses: any","messageClasses: any","renderComponents: any","renderSignInComponents","renderProps: BaseSignInRenderProps","result: any","CardPrimitive","Spinner","AlertPrimitive","Typography","BaseSignIn: FC<BaseSignInProps>","content: ReactElement","FlowProvider","ComponentPreferencesContext"],"sources":["../../../../../../../src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025-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 withVendorCSSClassPrefix,\n EmbeddedSignInFlowRequestV2 as EmbeddedSignInFlowRequest,\n EmbeddedFlowComponentV2 as EmbeddedFlowComponent,\n FlowMetadataResponse,\n Preferences,\n} from '@thunderid/browser';\nimport {FC, useState, useCallback, useContext, ReactElement, ReactNode} 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 {FormField, useForm} from '../../../../../hooks/useForm';\nimport useTranslation from '../../../../../hooks/useTranslation';\nimport {extractErrorMessage} from '../../../../../utils/v2/flowTransformer';\nimport AlertPrimitive from '../../../../primitives/Alert/Alert';\n// eslint-disable-next-line import/no-named-as-default\nimport CardPrimitive, {CardProps} from '../../../../primitives/Card/Card';\nimport Spinner from '../../../../primitives/Spinner/Spinner';\nimport Typography from '../../../../primitives/Typography/Typography';\nimport {renderSignInComponents} from '../../AuthOptionFactory';\nimport useStyles from '../BaseSignIn.styles';\n\n/**\n * Render props for custom UI rendering\n */\nexport interface BaseSignInRenderProps {\n /**\n * Flow components\n */\n components: EmbeddedFlowComponent[];\n\n /**\n * API error (if any)\n */\n error?: Error | null;\n\n /**\n * Field validation errors\n */\n fieldErrors: Record<string, string>;\n\n /**\n * Function to handle input changes\n */\n handleInputChange: (name: string, value: string) => void;\n\n /**\n * Function to handle form submission\n */\n handleSubmit: (component: EmbeddedFlowComponent, data?: Record<string, any>) => Promise<void>;\n\n /**\n * Loading state\n */\n isLoading: boolean;\n\n /**\n * Flag indicating if the step timer has reached zero\n */\n isTimeoutDisabled?: boolean;\n\n /**\n * Whether the form is valid\n */\n isValid: boolean;\n\n /**\n * Flow messages\n */\n messages: {message: string; type: string}[];\n\n /**\n * Flow metadata returned by the platform (v2 only). `null` while loading or unavailable.\n */\n meta: FlowMetadataResponse | null;\n\n /**\n * Flow subtitle\n */\n subtitle: string;\n\n /**\n * Flow title\n */\n title: string;\n\n /**\n * Touched fields\n */\n touched: Record<string, boolean>;\n\n /**\n * Function to validate the form\n */\n validateForm: () => {fieldErrors: Record<string, string>; isValid: boolean};\n\n /**\n * Form values\n */\n values: Record<string, string>;\n}\n\n/**\n * Props for the BaseSignIn component.\n */\nexport interface BaseSignInProps {\n /**\n * Additional data from the flow response.\n */\n additionalData?: Record<string, any>;\n\n /**\n * Custom CSS class name for the submit button.\n */\n buttonClassName?: string;\n\n /**\n * Render props function for custom UI\n */\n children?: (props: BaseSignInRenderProps) => ReactNode;\n\n /**\n * Custom CSS class name for the form container.\n */\n className?: string;\n\n /**\n * Array of flow components to render.\n */\n components?: EmbeddedFlowComponent[];\n\n /**\n * Error object to display\n */\n error?: Error | null;\n\n /**\n * Custom CSS class name for error messages.\n */\n errorClassName?: string;\n\n /**\n * Custom CSS class name for form inputs.\n */\n inputClassName?: string;\n\n /**\n * Flag to determine if the component is ready to be rendered.\n */\n isLoading?: boolean;\n\n /**\n * Timer flag disabling actions\n */\n isTimeoutDisabled?: boolean;\n\n /**\n * Custom CSS class name for info messages.\n */\n messageClassName?: string;\n\n /**\n * Callback function called when authentication fails.\n * @param error - The error that occurred during authentication.\n */\n onError?: (error: Error) => void;\n\n /**\n * Function to handle form submission.\n * @param payload - The form data to submit.\n * @param component - The component that triggered the submission.\n */\n onSubmit?: (payload: EmbeddedSignInFlowRequest, component: EmbeddedFlowComponent) => Promise<void>;\n\n /**\n * Callback function called when authentication is successful.\n * @param authData - The authentication data returned upon successful completion.\n */\n onSuccess?: (authData: Record<string, any>) => void;\n\n /**\n * Component-level preferences to override global i18n and theme settings.\n * Preferences are deep-merged with global ones, with component preferences\n * taking precedence. Affects this component and all its descendants.\n */\n preferences?: Preferences;\n\n /**\n * Size variant for the component.\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Theme variant for the component.\n */\n variant?: CardProps['variant'];\n}\n\n/**\n * Internal component that consumes FlowContext and renders the sign-in UI.\n */\nconst BaseSignInContent: FC<BaseSignInProps> = ({\n components = [],\n onSubmit,\n onError,\n error: externalError,\n className = '',\n inputClassName = '',\n buttonClassName = '',\n messageClassName = '',\n size = 'medium',\n variant = 'outlined',\n isLoading: externalIsLoading,\n children,\n additionalData = {},\n isTimeoutDisabled = false,\n}: BaseSignInProps): ReactElement => {\n const {meta} = useThunderID();\n const {theme} = useTheme();\n const customRenderers: ComponentRendererMap = useContext(ComponentRendererContext);\n const {t} = useTranslation();\n const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages} = useFlow();\n const styles: any = useStyles(theme, theme.vars.colors.text.primary);\n\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [apiError, setApiError] = useState<Error | null>(null);\n\n const isLoading: boolean = externalIsLoading || isSubmitting;\n\n /**\n * Handle error responses and extract meaningful error messages\n * Uses the transformer's extractErrorMessage function for consistency\n */\n const handleError: any = useCallback(\n (error: any) => {\n const errorMessage: string = extractErrorMessage(error, t);\n\n // Set the API error state\n setApiError(error instanceof Error ? error : new Error(errorMessage));\n\n // Clear existing messages and add the error message\n clearMessages();\n addMessage({\n message: errorMessage,\n type: 'error',\n });\n },\n [t, addMessage, clearMessages],\n );\n\n /**\n * Extract form fields from flow components\n */\n const extractFormFields: (components: EmbeddedFlowComponent[]) => FormField[] = useCallback(\n (flowComponents: EmbeddedFlowComponent[]): FormField[] => {\n const fields: FormField[] = [];\n\n const processComponents = (comps: EmbeddedFlowComponent[]): any => {\n comps.forEach((component: any) => {\n if (\n component.type === 'TEXT_INPUT' ||\n component.type === 'PASSWORD_INPUT' ||\n component.type === 'EMAIL_INPUT' ||\n component.type === 'PHONE_INPUT' ||\n component.type === 'OTP_INPUT'\n ) {\n const identifier: string = component.ref;\n fields.push({\n initialValue: '',\n name: identifier,\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 // Add email validation if it's an email field\n if (\n (component.type === 'EMAIL_INPUT' || component.variant === 'EMAIL') &&\n value &&\n !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)\n ) {\n return t('field.email.invalid');\n }\n\n return null;\n },\n });\n }\n if (component.components) {\n processComponents(component.components);\n }\n });\n };\n\n processComponents(flowComponents);\n return fields;\n },\n [t],\n );\n\n const formFields: FormField[] = components ? extractFormFields(components) : [];\n\n const form: ReturnType<typeof useForm> = 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 } = form;\n\n /**\n * Handle input value changes.\n * Only updates the value without marking as touched.\n * Touched state is set on blur to avoid premature validation.\n */\n const handleInputChange = (name: string, value: string): void => {\n setFormValue(name, value);\n };\n\n /**\n * Handle input blur event.\n * Marks the field as touched, which triggers validation.\n */\n const handleInputBlur = (name: string): void => {\n setFormTouched(name, true);\n };\n\n /**\n * Handle component submission (for buttons and actions).\n */\n const handleSubmit = async (\n component: EmbeddedFlowComponent,\n data?: Record<string, any>,\n skipValidation?: boolean,\n ): Promise<void> => {\n // Only validate for form submit actions, skip for social/trigger actions\n if (!skipValidation) {\n // Mark all fields as touched before validation\n touchAllFields();\n\n const validation: ReturnType<typeof validateForm> = validateForm();\n\n if (!validation.isValid) {\n return;\n }\n }\n\n setIsSubmitting(true);\n setApiError(null);\n clearMessages();\n\n try {\n // Filter out empty or undefined input values\n const filteredInputs: Record<string, any> = {};\n if (data) {\n Object.keys(data).forEach((key: any) => {\n if (data[key] !== undefined && data[key] !== null && data[key] !== '') {\n filteredInputs[key] = data[key];\n }\n });\n }\n\n let payload: EmbeddedSignInFlowRequest = {};\n\n // For V2, we always send inputs and action\n payload = {\n ...payload,\n ...(component.id && {action: component.id}),\n inputs: filteredInputs,\n };\n\n await onSubmit?.(payload, component);\n } catch (err) {\n handleError(err);\n onError?.(err as Error);\n } finally {\n setIsSubmitting(false);\n }\n };\n\n // Generate CSS classes\n const containerClasses: any = cx(\n [\n withVendorCSSClassPrefix('signin'),\n withVendorCSSClassPrefix(`signin--${size}`),\n withVendorCSSClassPrefix(`signin--${variant}`),\n ],\n className,\n );\n\n const inputClasses: any = cx(\n [\n withVendorCSSClassPrefix('signin__input'),\n size === 'small' && withVendorCSSClassPrefix('signin__input--small'),\n size === 'large' && withVendorCSSClassPrefix('signin__input--large'),\n ],\n inputClassName,\n );\n\n const buttonClasses: any = cx(\n [\n withVendorCSSClassPrefix('signin__button'),\n size === 'small' && withVendorCSSClassPrefix('signin__button--small'),\n size === 'large' && withVendorCSSClassPrefix('signin__button--large'),\n ],\n buttonClassName,\n );\n\n const messageClasses: any = cx([withVendorCSSClassPrefix('signin__messages')], messageClassName);\n\n /**\n * Render components based on flow data using the factory\n */\n const renderComponents: any = useCallback(\n (flowComponents: EmbeddedFlowComponent[]): ReactElement[] =>\n renderSignInComponents(\n flowComponents,\n formValues,\n touchedFields,\n formErrors,\n isLoading,\n isFormValid,\n handleInputChange,\n {\n _customRenderers: customRenderers,\n _theme: theme,\n additionalData,\n buttonClassName: buttonClasses,\n inputClassName: inputClasses,\n isTimeoutDisabled,\n meta,\n onInputBlur: handleInputBlur,\n onSubmit: handleSubmit,\n size,\n t,\n variant,\n },\n ),\n [\n additionalData,\n customRenderers,\n formValues,\n touchedFields,\n formErrors,\n isFormValid,\n meta,\n t,\n theme,\n isLoading,\n size,\n variant,\n inputClasses,\n buttonClasses,\n handleInputBlur,\n handleSubmit,\n isTimeoutDisabled,\n ],\n );\n\n // If render props are provided, use them\n if (children) {\n const renderProps: BaseSignInRenderProps = {\n components,\n error: apiError,\n fieldErrors: formErrors,\n handleInputChange,\n handleSubmit,\n isLoading,\n isTimeoutDisabled,\n isValid: isFormValid,\n messages: flowMessages || [],\n meta,\n subtitle: flowSubtitle ?? '',\n title: flowTitle || t('signin.heading'),\n touched: touchedFields,\n validateForm: () => {\n const result: any = validateForm();\n return {fieldErrors: result.errors, isValid: result.isValid};\n },\n values: formValues,\n };\n\n return (\n <div className={containerClasses} data-testid=\"thunderid-signin\">\n {children(renderProps)}\n </div>\n );\n }\n\n // Default UI rendering\n if (isLoading) {\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} data-testid=\"thunderid-signin\" variant={variant}>\n <CardPrimitive.Content>\n <div style={{display: 'flex', justifyContent: 'center', padding: '2rem'}}>\n <Spinner />\n </div>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n }\n\n if (!components || components.length === 0) {\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} data-testid=\"thunderid-signin\" variant={variant}>\n <CardPrimitive.Content>\n <AlertPrimitive variant=\"warning\">\n <Typography variant=\"body1\">{t('errors.signin.components.not.available')}</Typography>\n </AlertPrimitive>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n }\n\n return (\n <CardPrimitive className={cx(containerClasses, styles.card)} data-testid=\"thunderid-signin\" variant={variant}>\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: any) => (\n <AlertPrimitive\n key={index}\n variant={message.type === '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}>{renderComponents(components)}</div>\n </CardPrimitive.Content>\n </CardPrimitive>\n );\n};\n\n/**\n * Base SignIn component that provides generic authentication flow.\n * This component handles component-driven UI rendering and can transform input\n * structure to component-driven format automatically.\n *\n * @example\n * // Default UI\n * ```tsx\n * import { BaseSignIn } from '@thunderid/react';\n *\n * const MySignIn = () => {\n * return (\n * <BaseSignIn\n * components={components}\n * onSubmit={async (payload) => {\n * return await handleAuth(payload);\n * }}\n * onSuccess={(authData) => {\n * console.log('Success:', authData);\n * }}\n * className=\"max-w-md mx-auto\"\n * />\n * );\n * };\n * ```\n *\n * @example\n * // Custom UI with render props\n * ```tsx\n * <BaseSignIn components={components} onSubmit={handleSubmit}>\n * {({values, errors, handleInputChange, handleSubmit, isLoading, components}) => (\n * <div className=\"custom-form\">\n * <input\n * name=\"username\"\n * value={values.username || ''}\n * onChange={(e) => handleInputChange('username', e.target.value)}\n * />\n * {errors.username && <span>{errors.username}</span>}\n * <button\n * onClick={() => handleSubmit(components[0], values)}\n * disabled={isLoading}\n * >\n * Sign In\n * </button>\n * </div>\n * )}\n * </BaseSignIn>\n * ```\n */\nconst BaseSignIn: FC<BaseSignInProps> = ({preferences, ...rest}: BaseSignInProps): ReactElement => {\n const content: ReactElement = (\n <FlowProvider>\n <BaseSignInContent {...rest} />\n </FlowProvider>\n );\n\n if (!preferences) return content;\n\n return <ComponentPreferencesContext.Provider value={preferences}>{content}</ComponentPreferencesContext.Provider>;\n};\n\nexport default BaseSignIn;\n"],"mappings":"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"}
|
|
@@ -1,560 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_useThunderID = require('../../../../../contexts/ThunderID/useThunderID.cjs');
|
|
3
|
-
const require_useTranslation = require('../../../../../hooks/useTranslation.cjs');
|
|
4
|
-
const require_flowTransformer = require('../../../../../utils/v2/flowTransformer.cjs');
|
|
5
|
-
const require_BaseSignIn = require('./BaseSignIn.cjs');
|
|
6
|
-
const require_useOAuthCallback = require('../../../../../hooks/v2/useOAuthCallback.cjs');
|
|
7
|
-
const require_oauth = require('../../../../../utils/oauth.cjs');
|
|
8
|
-
const require_passkey = require('../../../../../utils/v2/passkey.cjs');
|
|
9
|
-
let __thunderid_browser = require("@thunderid/browser");
|
|
10
|
-
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
11
|
-
let react = require("react");
|
|
12
|
-
react = require_rolldown_runtime.__toESM(react);
|
|
13
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
-
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
15
|
-
|
|
16
|
-
//#region src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
17
|
-
/**
|
|
18
|
-
* A component-driven SignIn component that provides authentication flow with pre-built styling.
|
|
19
|
-
* This component handles the flow API calls for authentication and delegates UI logic to BaseSignIn.
|
|
20
|
-
* It automatically transforms simple input-based responses into component-driven UI format.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* // Default UI
|
|
24
|
-
* ```tsx
|
|
25
|
-
* import { SignIn } from '@thunderid/react/component-driven';
|
|
26
|
-
*
|
|
27
|
-
* const App = () => {
|
|
28
|
-
* return (
|
|
29
|
-
* <SignIn
|
|
30
|
-
* onSuccess={(authData) => {
|
|
31
|
-
* console.log('Authentication successful:', authData);
|
|
32
|
-
* }}
|
|
33
|
-
* onError={(error) => {
|
|
34
|
-
* console.error('Authentication failed:', error);
|
|
35
|
-
* }}
|
|
36
|
-
* size="medium"
|
|
37
|
-
* variant="outlined"
|
|
38
|
-
* />
|
|
39
|
-
* );
|
|
40
|
-
* };
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* // Custom UI with render props
|
|
45
|
-
* ```tsx
|
|
46
|
-
* import { SignIn } from '@thunderid/react/component-driven';
|
|
47
|
-
*
|
|
48
|
-
* const App = () => {
|
|
49
|
-
* return (
|
|
50
|
-
* <SignIn
|
|
51
|
-
* onSuccess={(authData) => console.log('Success:', authData)}
|
|
52
|
-
* onError={(error) => console.error('Error:', error)}
|
|
53
|
-
* >
|
|
54
|
-
* {({signIn, isLoading, components, error, isInitialized}) => (
|
|
55
|
-
* <div className="custom-signin">
|
|
56
|
-
* <h1>Custom Sign In</h1>
|
|
57
|
-
* {!isInitialized ? (
|
|
58
|
-
* <p>Initializing...</p>
|
|
59
|
-
* ) : error ? (
|
|
60
|
-
* <div className="error">{error.message}</div>
|
|
61
|
-
* ) : (
|
|
62
|
-
* <form onSubmit={(e) => {
|
|
63
|
-
* e.preventDefault();
|
|
64
|
-
* signIn({inputs: {username: 'user', password: 'pass'}});
|
|
65
|
-
* }}>
|
|
66
|
-
* <button type="submit" disabled={isLoading}>
|
|
67
|
-
* {isLoading ? 'Signing in...' : 'Sign In'}
|
|
68
|
-
* </button>
|
|
69
|
-
* </form>
|
|
70
|
-
* )}
|
|
71
|
-
* </div>
|
|
72
|
-
* )}
|
|
73
|
-
* </SignIn>
|
|
74
|
-
* );
|
|
75
|
-
* };
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
const SignIn = ({ className, preferences, size = "medium", onSuccess, onError, variant, children }) => {
|
|
79
|
-
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading, meta, getStorageManager, scopes } = require_useThunderID.default();
|
|
80
|
-
const { t } = require_useTranslation.default(preferences?.i18n);
|
|
81
|
-
const [components, setComponents] = (0, react.useState)([]);
|
|
82
|
-
const [additionalData, setAdditionalData] = (0, react.useState)({});
|
|
83
|
-
const [currentExecutionId, setCurrentExecutionId] = (0, react.useState)(null);
|
|
84
|
-
const challengeTokenRef = (0, react.useRef)(null);
|
|
85
|
-
const [isStorageReady, setIsStorageReady] = (0, react.useState)(false);
|
|
86
|
-
const [isFlowInitialized, setIsFlowInitialized] = (0, react.useState)(false);
|
|
87
|
-
const [flowError, setFlowError] = (0, react.useState)(null);
|
|
88
|
-
const [isSubmitting, setIsSubmitting] = (0, react.useState)(false);
|
|
89
|
-
const [isTimeoutDisabled, setIsTimeoutDisabled] = (0, react.useState)(false);
|
|
90
|
-
const [passkeyState, setPasskeyState] = (0, react.useState)({
|
|
91
|
-
actionId: null,
|
|
92
|
-
challenge: null,
|
|
93
|
-
creationOptions: null,
|
|
94
|
-
error: null,
|
|
95
|
-
executionId: null,
|
|
96
|
-
isActive: false
|
|
97
|
-
});
|
|
98
|
-
const initializationAttemptedRef = (0, react.useRef)(false);
|
|
99
|
-
const oauthCodeProcessedRef = (0, react.useRef)(false);
|
|
100
|
-
const passkeyProcessedRef = (0, react.useRef)(false);
|
|
101
|
-
/**
|
|
102
|
-
* Sets executionId between sessionStorage and state.
|
|
103
|
-
* This ensures both are always in sync.
|
|
104
|
-
*/
|
|
105
|
-
const setExecutionId = (executionId) => {
|
|
106
|
-
setCurrentExecutionId(executionId);
|
|
107
|
-
if (executionId) sessionStorage.setItem("thunderid_execution_id", executionId);
|
|
108
|
-
else sessionStorage.removeItem("thunderid_execution_id");
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Restore any challenge token persisted before an OAuth redirect.
|
|
112
|
-
* Waits for SDK initialization before reading from storage.
|
|
113
|
-
*/
|
|
114
|
-
(0, react.useEffect)(() => {
|
|
115
|
-
if (!isInitialized) return;
|
|
116
|
-
(async () => {
|
|
117
|
-
try {
|
|
118
|
-
const tempData = await (await getStorageManager())?.getTemporaryData();
|
|
119
|
-
if (tempData?.challengeToken) challengeTokenRef.current = tempData.challengeToken;
|
|
120
|
-
} finally {
|
|
121
|
-
setIsStorageReady(true);
|
|
122
|
-
}
|
|
123
|
-
})();
|
|
124
|
-
}, [isInitialized]);
|
|
125
|
-
/**
|
|
126
|
-
* Updates challengeTokenRef immediately (stale-closure safe) and persists via
|
|
127
|
-
* the provider's StorageManager so the token survives OAuth redirects.
|
|
128
|
-
*/
|
|
129
|
-
const setChallengeToken = async (challengeToken) => {
|
|
130
|
-
challengeTokenRef.current = challengeToken;
|
|
131
|
-
try {
|
|
132
|
-
const storageManager = await getStorageManager();
|
|
133
|
-
if (storageManager) if (challengeToken) await storageManager.setTemporaryDataParameter("challengeToken", challengeToken);
|
|
134
|
-
else await storageManager.removeTemporaryDataParameter("challengeToken");
|
|
135
|
-
} catch {
|
|
136
|
-
__thunderid_browser.logger.warn("Failed to persist challenge token in storage.");
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* Clear all flow-related storage and state.
|
|
141
|
-
*/
|
|
142
|
-
const clearFlowState = async () => {
|
|
143
|
-
setExecutionId(null);
|
|
144
|
-
await setChallengeToken(null);
|
|
145
|
-
setIsFlowInitialized(false);
|
|
146
|
-
try {
|
|
147
|
-
await (await getStorageManager())?.removeHybridDataParameter?.("authId");
|
|
148
|
-
} catch {
|
|
149
|
-
__thunderid_browser.logger.warn("Failed to clear authId from hybrid storage.");
|
|
150
|
-
}
|
|
151
|
-
setIsTimeoutDisabled(false);
|
|
152
|
-
oauthCodeProcessedRef.current = false;
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* Parse URL parameters used in flows.
|
|
156
|
-
*/
|
|
157
|
-
const getUrlParams = () => {
|
|
158
|
-
const urlParams = new URL(window?.location?.href ?? "").searchParams;
|
|
159
|
-
return {
|
|
160
|
-
applicationId: urlParams.get("applicationId"),
|
|
161
|
-
authId: urlParams.get("authId"),
|
|
162
|
-
code: urlParams.get("code"),
|
|
163
|
-
error: urlParams.get("error"),
|
|
164
|
-
errorDescription: urlParams.get("error_description"),
|
|
165
|
-
executionId: urlParams.get("executionId"),
|
|
166
|
-
nonce: urlParams.get("nonce"),
|
|
167
|
-
state: urlParams.get("state")
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* Handle authId from URL and store it in sessionStorage.
|
|
172
|
-
*/
|
|
173
|
-
const handleAuthId = async (authId) => {
|
|
174
|
-
if (authId) try {
|
|
175
|
-
await (await getStorageManager())?.setHybridDataParameter?.("authId", authId);
|
|
176
|
-
} catch {
|
|
177
|
-
__thunderid_browser.logger.warn("Failed to store authId in hybrid storage.");
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* Clean up OAuth-related URL parameters from the browser URL.
|
|
182
|
-
*/
|
|
183
|
-
const cleanupOAuthUrlParams = (includeNonce = false) => {
|
|
184
|
-
if (!window?.location?.href) return;
|
|
185
|
-
const url = new URL(window.location.href);
|
|
186
|
-
url.searchParams.delete("error");
|
|
187
|
-
url.searchParams.delete("error_description");
|
|
188
|
-
url.searchParams.delete("code");
|
|
189
|
-
url.searchParams.delete("state");
|
|
190
|
-
if (includeNonce) url.searchParams.delete("nonce");
|
|
191
|
-
window?.history?.replaceState({}, "", url.toString());
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Clean up flow-related URL parameters (executionId, authId) from the browser URL.
|
|
195
|
-
* Used after executionId is set in state to prevent using invalidated executionId from URL.
|
|
196
|
-
*/
|
|
197
|
-
const cleanupFlowUrlParams = () => {
|
|
198
|
-
if (!window?.location?.href) return;
|
|
199
|
-
const url = new URL(window.location.href);
|
|
200
|
-
url.searchParams.delete("executionId");
|
|
201
|
-
url.searchParams.delete("authId");
|
|
202
|
-
url.searchParams.delete("applicationId");
|
|
203
|
-
window?.history?.replaceState({}, "", url.toString());
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Set error state and call onError callback.
|
|
207
|
-
* Ensures isFlowInitialized is true so errors can be displayed in the UI.
|
|
208
|
-
*/
|
|
209
|
-
const setError = (error) => {
|
|
210
|
-
setFlowError(error);
|
|
211
|
-
setIsFlowInitialized(true);
|
|
212
|
-
onError?.(error);
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* Handle OAuth error from URL parameters.
|
|
216
|
-
* Clears flow state, creates error, and cleans up URL.
|
|
217
|
-
*/
|
|
218
|
-
const handleOAuthError = (error, errorDescription) => {
|
|
219
|
-
clearFlowState();
|
|
220
|
-
setError(new __thunderid_browser.ThunderIDRuntimeError(errorDescription || `OAuth error: ${error}`, "SIGN_IN_ERROR", "react"));
|
|
221
|
-
cleanupOAuthUrlParams(true);
|
|
222
|
-
};
|
|
223
|
-
/**
|
|
224
|
-
* Handle REDIRECTION response by storing flow state and redirecting to OAuth provider.
|
|
225
|
-
*/
|
|
226
|
-
const handleRedirection = async (response) => {
|
|
227
|
-
if (response.type === __thunderid_browser.EmbeddedSignInFlowTypeV2.Redirection) {
|
|
228
|
-
const redirectURL = response.data?.redirectURL || response?.redirectURL;
|
|
229
|
-
if (redirectURL && window?.location) {
|
|
230
|
-
if (response.executionId) setExecutionId(response.executionId);
|
|
231
|
-
await setChallengeToken(response.challengeToken ?? null);
|
|
232
|
-
handleAuthId(getUrlParams().authId);
|
|
233
|
-
require_oauth.initiateOAuthRedirect(redirectURL);
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return false;
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* Initialize the authentication flow.
|
|
241
|
-
* Priority: executionId > applicationId (from context) > applicationId (from URL)
|
|
242
|
-
*/
|
|
243
|
-
const initializeFlow = async () => {
|
|
244
|
-
const urlParams = getUrlParams();
|
|
245
|
-
oauthCodeProcessedRef.current = false;
|
|
246
|
-
handleAuthId(urlParams.authId);
|
|
247
|
-
const effectiveApplicationId = applicationId || urlParams.applicationId;
|
|
248
|
-
if (!urlParams.executionId && !effectiveApplicationId) {
|
|
249
|
-
const error = new __thunderid_browser.ThunderIDRuntimeError("Either executionId or applicationId is required for authentication", "SIGN_IN_ERROR", "react");
|
|
250
|
-
setError(error);
|
|
251
|
-
throw error;
|
|
252
|
-
}
|
|
253
|
-
try {
|
|
254
|
-
setFlowError(null);
|
|
255
|
-
let response;
|
|
256
|
-
if (urlParams.executionId) response = await signIn({
|
|
257
|
-
executionId: urlParams.executionId,
|
|
258
|
-
...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {}
|
|
259
|
-
});
|
|
260
|
-
else response = await signIn({
|
|
261
|
-
applicationId: effectiveApplicationId,
|
|
262
|
-
flowType: __thunderid_browser.EmbeddedFlowType.Authentication,
|
|
263
|
-
...scopes && { scopes }
|
|
264
|
-
});
|
|
265
|
-
if (await handleRedirection(response)) return;
|
|
266
|
-
const { executionId: normalizedExecutionId, components: normalizedComponents, additionalData: normalizedAdditionalData } = require_flowTransformer.normalizeFlowResponse(response, t, { resolveTranslations: false }, meta);
|
|
267
|
-
await setChallengeToken(response.challengeToken ?? null);
|
|
268
|
-
if (normalizedExecutionId && normalizedComponents) {
|
|
269
|
-
setExecutionId(normalizedExecutionId);
|
|
270
|
-
setComponents(normalizedComponents);
|
|
271
|
-
setAdditionalData(normalizedAdditionalData ?? {});
|
|
272
|
-
setIsFlowInitialized(true);
|
|
273
|
-
setIsTimeoutDisabled(false);
|
|
274
|
-
cleanupFlowUrlParams();
|
|
275
|
-
}
|
|
276
|
-
} catch (error) {
|
|
277
|
-
const err = error;
|
|
278
|
-
await clearFlowState();
|
|
279
|
-
setError(err instanceof __thunderid_browser.ThunderIDRuntimeError ? err : new Error(require_flowTransformer.extractErrorMessage(err, t)));
|
|
280
|
-
initializationAttemptedRef.current = false;
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
/**
|
|
284
|
-
* Initialize the flow and handle cleanup of stale flow state.
|
|
285
|
-
*/
|
|
286
|
-
(0, react.useEffect)(() => {
|
|
287
|
-
const urlParams = getUrlParams();
|
|
288
|
-
if (urlParams.error) {
|
|
289
|
-
handleOAuthError(urlParams.error, urlParams.errorDescription);
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
handleAuthId(urlParams.authId);
|
|
293
|
-
}, []);
|
|
294
|
-
(0, react.useEffect)(() => {
|
|
295
|
-
const currentUrlParams = getUrlParams();
|
|
296
|
-
if (isInitialized && !isLoading && isStorageReady && !isFlowInitialized && !initializationAttemptedRef.current && !currentExecutionId && !currentUrlParams.code && !currentUrlParams.state && !isSubmitting && !oauthCodeProcessedRef.current) {
|
|
297
|
-
initializationAttemptedRef.current = true;
|
|
298
|
-
initializeFlow();
|
|
299
|
-
}
|
|
300
|
-
}, [
|
|
301
|
-
isInitialized,
|
|
302
|
-
isLoading,
|
|
303
|
-
isStorageReady,
|
|
304
|
-
isFlowInitialized,
|
|
305
|
-
currentExecutionId
|
|
306
|
-
]);
|
|
307
|
-
/**
|
|
308
|
-
* Handle step timeout if configured in additionalData.
|
|
309
|
-
*/
|
|
310
|
-
(0, react.useEffect)(() => {
|
|
311
|
-
const timeoutMs = Number(additionalData?.["stepTimeout"]) || 0;
|
|
312
|
-
if (timeoutMs <= 0 || !isFlowInitialized) {
|
|
313
|
-
setIsTimeoutDisabled(false);
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
const remaining = Math.max(0, Math.floor((timeoutMs - Date.now()) / 1e3));
|
|
317
|
-
const handleTimeout = () => {
|
|
318
|
-
const errorMessage = t("errors.signin.timeout") || "Time allowed to complete the step has expired.";
|
|
319
|
-
setError(new Error(errorMessage));
|
|
320
|
-
setIsTimeoutDisabled(true);
|
|
321
|
-
};
|
|
322
|
-
if (remaining <= 0) {
|
|
323
|
-
handleTimeout();
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
const timerId = setTimeout(() => {
|
|
327
|
-
handleTimeout();
|
|
328
|
-
}, remaining * 1e3);
|
|
329
|
-
return () => clearTimeout(timerId);
|
|
330
|
-
}, [
|
|
331
|
-
additionalData?.["stepTimeout"],
|
|
332
|
-
isFlowInitialized,
|
|
333
|
-
t
|
|
334
|
-
]);
|
|
335
|
-
/**
|
|
336
|
-
* Handle form submission from BaseSignIn or render props.
|
|
337
|
-
*/
|
|
338
|
-
const handleSubmit = async (payload) => {
|
|
339
|
-
const effectiveExecutionId = payload.executionId || currentExecutionId;
|
|
340
|
-
if (!effectiveExecutionId) throw new Error("No active flow ID");
|
|
341
|
-
const processedInputs = { ...payload.inputs };
|
|
342
|
-
if (additionalData?.["consentPrompt"]) try {
|
|
343
|
-
const consentPromptRawData = additionalData["consentPrompt"];
|
|
344
|
-
const purposes = typeof consentPromptRawData === "string" ? JSON.parse(consentPromptRawData) : consentPromptRawData.purposes || consentPromptRawData;
|
|
345
|
-
let isDeny = false;
|
|
346
|
-
if (payload.action) {
|
|
347
|
-
const findAction = (comps) => {
|
|
348
|
-
if (!comps || comps.length === 0) return null;
|
|
349
|
-
const found = comps.find((c) => c.id === payload.action);
|
|
350
|
-
if (found) return found;
|
|
351
|
-
return comps.reduce((acc, c) => {
|
|
352
|
-
if (acc) return acc;
|
|
353
|
-
if (c.components) return findAction(c.components);
|
|
354
|
-
return null;
|
|
355
|
-
}, null);
|
|
356
|
-
};
|
|
357
|
-
const submitAction = findAction(components);
|
|
358
|
-
if (submitAction && submitAction.variant?.toLowerCase() !== "primary") isDeny = true;
|
|
359
|
-
}
|
|
360
|
-
const decisions = { purposes: purposes.map((p) => ({
|
|
361
|
-
approved: !isDeny,
|
|
362
|
-
elements: [...(p.essential || []).map((e) => ({
|
|
363
|
-
approved: !isDeny,
|
|
364
|
-
name: e.name
|
|
365
|
-
})), ...(p.optional || []).map((e) => {
|
|
366
|
-
const key = `__consent_opt__${p.purposeId}__${e.name}`;
|
|
367
|
-
return {
|
|
368
|
-
approved: isDeny ? false : processedInputs[key] !== "false",
|
|
369
|
-
name: e.name
|
|
370
|
-
};
|
|
371
|
-
})],
|
|
372
|
-
purposeName: p.purposeName
|
|
373
|
-
})) };
|
|
374
|
-
processedInputs["consent_decisions"] = JSON.stringify(decisions);
|
|
375
|
-
Object.keys(processedInputs).forEach((key) => {
|
|
376
|
-
if (key.startsWith("__consent_opt__")) delete processedInputs[key];
|
|
377
|
-
});
|
|
378
|
-
} catch (e) {}
|
|
379
|
-
try {
|
|
380
|
-
setIsSubmitting(true);
|
|
381
|
-
setFlowError(null);
|
|
382
|
-
const response = await signIn({
|
|
383
|
-
executionId: effectiveExecutionId,
|
|
384
|
-
...payload,
|
|
385
|
-
inputs: processedInputs,
|
|
386
|
-
...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {}
|
|
387
|
-
});
|
|
388
|
-
if (await handleRedirection(response)) return;
|
|
389
|
-
if (response.data?.additionalData?.["passkeyChallenge"] || response.data?.additionalData?.["passkeyCreationOptions"]) {
|
|
390
|
-
const { passkeyChallenge, passkeyCreationOptions } = response.data.additionalData;
|
|
391
|
-
const effectiveExecutionIdForPasskey = response.executionId || effectiveExecutionId;
|
|
392
|
-
passkeyProcessedRef.current = false;
|
|
393
|
-
await setChallengeToken(response.challengeToken ?? null);
|
|
394
|
-
setPasskeyState({
|
|
395
|
-
actionId: "submit",
|
|
396
|
-
challenge: passkeyChallenge,
|
|
397
|
-
creationOptions: passkeyCreationOptions,
|
|
398
|
-
error: null,
|
|
399
|
-
executionId: effectiveExecutionIdForPasskey,
|
|
400
|
-
isActive: true
|
|
401
|
-
});
|
|
402
|
-
setIsSubmitting(false);
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
const { executionId: normalizedExecutionId, components: normalizedComponents, additionalData: normalizedAdditionalData } = require_flowTransformer.normalizeFlowResponse(response, t, { resolveTranslations: false }, meta);
|
|
406
|
-
if (response.flowStatus === __thunderid_browser.EmbeddedSignInFlowStatusV2.Error) {
|
|
407
|
-
await clearFlowState();
|
|
408
|
-
const err = new Error(require_flowTransformer.extractErrorMessage(response, t));
|
|
409
|
-
setError(err);
|
|
410
|
-
cleanupFlowUrlParams();
|
|
411
|
-
throw err;
|
|
412
|
-
}
|
|
413
|
-
if (response.flowStatus === __thunderid_browser.EmbeddedSignInFlowStatusV2.Complete) {
|
|
414
|
-
const finalRedirectUrl = response?.redirectUrl || response?.redirect_uri || afterSignInUrl;
|
|
415
|
-
setIsSubmitting(false);
|
|
416
|
-
setExecutionId(null);
|
|
417
|
-
await setChallengeToken(null);
|
|
418
|
-
setIsFlowInitialized(false);
|
|
419
|
-
sessionStorage.removeItem("thunderid_execution_id");
|
|
420
|
-
try {
|
|
421
|
-
await (await getStorageManager())?.removeHybridDataParameter?.("authId");
|
|
422
|
-
} catch {
|
|
423
|
-
__thunderid_browser.logger.warn("Failed to clear authId from hybrid storage after completion.");
|
|
424
|
-
}
|
|
425
|
-
cleanupOAuthUrlParams(true);
|
|
426
|
-
if (onSuccess) onSuccess({
|
|
427
|
-
redirectUrl: finalRedirectUrl,
|
|
428
|
-
...response.data || {}
|
|
429
|
-
});
|
|
430
|
-
if (finalRedirectUrl && window?.location) window.location.href = finalRedirectUrl;
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
await setChallengeToken(response.challengeToken ?? null);
|
|
434
|
-
if (normalizedExecutionId && normalizedComponents) {
|
|
435
|
-
setExecutionId(normalizedExecutionId);
|
|
436
|
-
setComponents(normalizedComponents);
|
|
437
|
-
setAdditionalData(normalizedAdditionalData ?? {});
|
|
438
|
-
setIsTimeoutDisabled(false);
|
|
439
|
-
setIsFlowInitialized(true);
|
|
440
|
-
cleanupFlowUrlParams();
|
|
441
|
-
if (response?.error) setFlowError(new Error(require_flowTransformer.extractErrorMessage(response, t)));
|
|
442
|
-
}
|
|
443
|
-
} catch (error) {
|
|
444
|
-
const err = error;
|
|
445
|
-
await clearFlowState();
|
|
446
|
-
setError(err instanceof __thunderid_browser.ThunderIDRuntimeError ? err : new Error(require_flowTransformer.extractErrorMessage(err, t)));
|
|
447
|
-
return;
|
|
448
|
-
} finally {
|
|
449
|
-
setIsSubmitting(false);
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
/**
|
|
453
|
-
* Handle authentication errors.
|
|
454
|
-
*/
|
|
455
|
-
const handleError = (error) => {
|
|
456
|
-
setError(error);
|
|
457
|
-
};
|
|
458
|
-
require_useOAuthCallback.useOAuthCallback({
|
|
459
|
-
currentExecutionId,
|
|
460
|
-
isInitialized: isInitialized && !isLoading && isStorageReady,
|
|
461
|
-
isSubmitting,
|
|
462
|
-
onError: (err) => {
|
|
463
|
-
clearFlowState();
|
|
464
|
-
setError(err instanceof Error ? err : new Error(String(err)));
|
|
465
|
-
},
|
|
466
|
-
onSubmit: async (payload) => handleSubmit({
|
|
467
|
-
executionId: payload.executionId,
|
|
468
|
-
inputs: payload.inputs
|
|
469
|
-
}),
|
|
470
|
-
processedRef: oauthCodeProcessedRef,
|
|
471
|
-
setExecutionId
|
|
472
|
-
});
|
|
473
|
-
/**
|
|
474
|
-
* Handle passkey authentication/registration when passkey state becomes active.
|
|
475
|
-
* This effect auto-triggers the browser passkey popup and submits the result.
|
|
476
|
-
*/
|
|
477
|
-
(0, react.useEffect)(() => {
|
|
478
|
-
if (!passkeyState.isActive || !passkeyState.challenge && !passkeyState.creationOptions || !passkeyState.executionId) return;
|
|
479
|
-
if (passkeyProcessedRef.current) return;
|
|
480
|
-
passkeyProcessedRef.current = true;
|
|
481
|
-
const performPasskeyProcess = async () => {
|
|
482
|
-
let inputs;
|
|
483
|
-
if (passkeyState.challenge) {
|
|
484
|
-
const passkeyResponse = await require_passkey.handlePasskeyAuthentication(passkeyState.challenge);
|
|
485
|
-
const passkeyResponseObj = JSON.parse(passkeyResponse);
|
|
486
|
-
inputs = {
|
|
487
|
-
authenticatorData: passkeyResponseObj.response.authenticatorData,
|
|
488
|
-
clientDataJSON: passkeyResponseObj.response.clientDataJSON,
|
|
489
|
-
credentialId: passkeyResponseObj.id,
|
|
490
|
-
signature: passkeyResponseObj.response.signature,
|
|
491
|
-
userHandle: passkeyResponseObj.response.userHandle
|
|
492
|
-
};
|
|
493
|
-
} else if (passkeyState.creationOptions) {
|
|
494
|
-
const passkeyResponse = await require_passkey.handlePasskeyRegistration(passkeyState.creationOptions);
|
|
495
|
-
const passkeyResponseObj = JSON.parse(passkeyResponse);
|
|
496
|
-
inputs = {
|
|
497
|
-
attestationObject: passkeyResponseObj.response.attestationObject,
|
|
498
|
-
clientDataJSON: passkeyResponseObj.response.clientDataJSON,
|
|
499
|
-
credentialId: passkeyResponseObj.id
|
|
500
|
-
};
|
|
501
|
-
} else throw new Error("No passkey challenge or creation options available");
|
|
502
|
-
await handleSubmit({
|
|
503
|
-
executionId: passkeyState.executionId ?? void 0,
|
|
504
|
-
inputs
|
|
505
|
-
});
|
|
506
|
-
};
|
|
507
|
-
performPasskeyProcess().then(() => {
|
|
508
|
-
setPasskeyState({
|
|
509
|
-
actionId: null,
|
|
510
|
-
challenge: null,
|
|
511
|
-
creationOptions: null,
|
|
512
|
-
error: null,
|
|
513
|
-
executionId: null,
|
|
514
|
-
isActive: false
|
|
515
|
-
});
|
|
516
|
-
}).catch((error) => {
|
|
517
|
-
setPasskeyState((prev) => ({
|
|
518
|
-
...prev,
|
|
519
|
-
error,
|
|
520
|
-
isActive: false
|
|
521
|
-
}));
|
|
522
|
-
setFlowError(error);
|
|
523
|
-
onError?.(error);
|
|
524
|
-
});
|
|
525
|
-
}, [
|
|
526
|
-
passkeyState.isActive,
|
|
527
|
-
passkeyState.challenge,
|
|
528
|
-
passkeyState.creationOptions,
|
|
529
|
-
passkeyState.executionId
|
|
530
|
-
]);
|
|
531
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children({
|
|
532
|
-
additionalData,
|
|
533
|
-
components,
|
|
534
|
-
error: flowError,
|
|
535
|
-
initialize: initializeFlow,
|
|
536
|
-
isInitialized: isFlowInitialized,
|
|
537
|
-
isLoading: isLoading || isSubmitting || !isInitialized,
|
|
538
|
-
isTimeoutDisabled,
|
|
539
|
-
meta,
|
|
540
|
-
onSubmit: handleSubmit
|
|
541
|
-
}) });
|
|
542
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_BaseSignIn.default, {
|
|
543
|
-
additionalData,
|
|
544
|
-
components,
|
|
545
|
-
isLoading: isLoading || !isInitialized || !isFlowInitialized,
|
|
546
|
-
isTimeoutDisabled,
|
|
547
|
-
onSubmit: handleSubmit,
|
|
548
|
-
onError: handleError,
|
|
549
|
-
error: flowError,
|
|
550
|
-
className,
|
|
551
|
-
size,
|
|
552
|
-
variant,
|
|
553
|
-
preferences
|
|
554
|
-
});
|
|
555
|
-
};
|
|
556
|
-
var SignIn_default = SignIn;
|
|
557
|
-
|
|
558
|
-
//#endregion
|
|
559
|
-
exports.default = SignIn_default;
|
|
560
|
-
//# sourceMappingURL=SignIn.cjs.map
|