@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,27 +1,34 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_useThunderID = require('../../../../contexts/ThunderID/useThunderID.cjs');
|
|
3
|
+
const require_useTranslation = require('../../../../hooks/useTranslation.cjs');
|
|
4
|
+
const require_flowTransformer = require('../../../../utils/flowTransformer.cjs');
|
|
3
5
|
const require_BaseSignIn = require('./BaseSignIn.cjs');
|
|
4
|
-
const
|
|
6
|
+
const require_useOAuthCallback = require('../../../../hooks/useOAuthCallback.cjs');
|
|
7
|
+
const require_oauth = require('../../../../utils/oauth.cjs');
|
|
8
|
+
const require_passkey = require('../../../../utils/passkey.cjs');
|
|
5
9
|
let __thunderid_browser = require("@thunderid/browser");
|
|
6
10
|
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
11
|
+
let react = require("react");
|
|
12
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
7
13
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
14
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
9
15
|
|
|
10
16
|
//#region src/components/presentation/auth/SignIn/SignIn.tsx
|
|
11
17
|
/**
|
|
12
|
-
* A
|
|
13
|
-
* This component handles the API calls for authentication and delegates UI logic to BaseSignIn.
|
|
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.
|
|
14
21
|
*
|
|
15
22
|
* @example
|
|
23
|
+
* // Default UI
|
|
16
24
|
* ```tsx
|
|
17
|
-
* import { SignIn } from '@thunderid/react';
|
|
25
|
+
* import { SignIn } from '@thunderid/react/component-driven';
|
|
18
26
|
*
|
|
19
27
|
* const App = () => {
|
|
20
28
|
* return (
|
|
21
29
|
* <SignIn
|
|
22
30
|
* onSuccess={(authData) => {
|
|
23
31
|
* console.log('Authentication successful:', authData);
|
|
24
|
-
* // Handle successful authentication (e.g., redirect, store tokens)
|
|
25
32
|
* }}
|
|
26
33
|
* onError={(error) => {
|
|
27
34
|
* console.error('Authentication failed:', error);
|
|
@@ -32,55 +39,559 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
32
39
|
* );
|
|
33
40
|
* };
|
|
34
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
|
+
* ```
|
|
35
77
|
*/
|
|
36
|
-
const SignIn = ({ className, size = "medium",
|
|
37
|
-
const {
|
|
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 [serverFieldErrors, setServerFieldErrors] = (0, react.useState)(null);
|
|
84
|
+
const [currentExecutionId, setCurrentExecutionId] = (0, react.useState)(null);
|
|
85
|
+
const challengeTokenRef = (0, react.useRef)(null);
|
|
86
|
+
const [isStorageReady, setIsStorageReady] = (0, react.useState)(false);
|
|
87
|
+
const [isFlowInitialized, setIsFlowInitialized] = (0, react.useState)(false);
|
|
88
|
+
const [flowError, setFlowError] = (0, react.useState)(null);
|
|
89
|
+
const [isSubmitting, setIsSubmitting] = (0, react.useState)(false);
|
|
90
|
+
const [isTimeoutDisabled, setIsTimeoutDisabled] = (0, react.useState)(false);
|
|
91
|
+
const [passkeyState, setPasskeyState] = (0, react.useState)({
|
|
92
|
+
actionId: null,
|
|
93
|
+
challenge: null,
|
|
94
|
+
creationOptions: null,
|
|
95
|
+
error: null,
|
|
96
|
+
executionId: null,
|
|
97
|
+
isActive: false
|
|
98
|
+
});
|
|
99
|
+
const initializationAttemptedRef = (0, react.useRef)(false);
|
|
100
|
+
const oauthCodeProcessedRef = (0, react.useRef)(false);
|
|
101
|
+
const passkeyProcessedRef = (0, react.useRef)(false);
|
|
102
|
+
/**
|
|
103
|
+
* Sets executionId between sessionStorage and state.
|
|
104
|
+
* This ensures both are always in sync.
|
|
105
|
+
*/
|
|
106
|
+
const setExecutionId = (executionId) => {
|
|
107
|
+
setCurrentExecutionId(executionId);
|
|
108
|
+
if (executionId) sessionStorage.setItem("thunderid_execution_id", executionId);
|
|
109
|
+
else sessionStorage.removeItem("thunderid_execution_id");
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Restore any challenge token persisted before an OAuth redirect.
|
|
113
|
+
* Waits for SDK initialization before reading from storage.
|
|
114
|
+
*/
|
|
115
|
+
(0, react.useEffect)(() => {
|
|
116
|
+
if (!isInitialized) return;
|
|
117
|
+
(async () => {
|
|
118
|
+
try {
|
|
119
|
+
const tempData = await (await getStorageManager())?.getTemporaryData();
|
|
120
|
+
if (tempData?.challengeToken) challengeTokenRef.current = tempData.challengeToken;
|
|
121
|
+
} finally {
|
|
122
|
+
setIsStorageReady(true);
|
|
123
|
+
}
|
|
124
|
+
})();
|
|
125
|
+
}, [isInitialized]);
|
|
126
|
+
/**
|
|
127
|
+
* Updates challengeTokenRef immediately (stale-closure safe) and persists via
|
|
128
|
+
* the provider's StorageManager so the token survives OAuth redirects.
|
|
129
|
+
*/
|
|
130
|
+
const setChallengeToken = async (challengeToken) => {
|
|
131
|
+
challengeTokenRef.current = challengeToken;
|
|
132
|
+
try {
|
|
133
|
+
const storageManager = await getStorageManager();
|
|
134
|
+
if (storageManager) if (challengeToken) await storageManager.setTemporaryDataParameter("challengeToken", challengeToken);
|
|
135
|
+
else await storageManager.removeTemporaryDataParameter("challengeToken");
|
|
136
|
+
} catch {
|
|
137
|
+
__thunderid_browser.logger.warn("Failed to persist challenge token in storage.");
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Clear all flow-related storage and state.
|
|
142
|
+
*/
|
|
143
|
+
const clearFlowState = async () => {
|
|
144
|
+
setExecutionId(null);
|
|
145
|
+
await setChallengeToken(null);
|
|
146
|
+
setIsFlowInitialized(false);
|
|
147
|
+
try {
|
|
148
|
+
await (await getStorageManager())?.removeHybridDataParameter?.("authId");
|
|
149
|
+
} catch {
|
|
150
|
+
__thunderid_browser.logger.warn("Failed to clear authId from hybrid storage.");
|
|
151
|
+
}
|
|
152
|
+
setIsTimeoutDisabled(false);
|
|
153
|
+
oauthCodeProcessedRef.current = false;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Parse URL parameters used in flows.
|
|
157
|
+
*/
|
|
158
|
+
const getUrlParams = () => {
|
|
159
|
+
const urlParams = new URL(window?.location?.href ?? "").searchParams;
|
|
160
|
+
return {
|
|
161
|
+
applicationId: urlParams.get("applicationId"),
|
|
162
|
+
authId: urlParams.get("authId"),
|
|
163
|
+
code: urlParams.get("code"),
|
|
164
|
+
error: urlParams.get("error"),
|
|
165
|
+
errorDescription: urlParams.get("error_description"),
|
|
166
|
+
executionId: urlParams.get("executionId"),
|
|
167
|
+
nonce: urlParams.get("nonce"),
|
|
168
|
+
state: urlParams.get("state")
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Handle authId from URL and persist it via the storage manager so it survives URL cleanup.
|
|
173
|
+
* ThunderIDReactClient.signIn() reads authId from storageManager.getHybridDataParameter('authId'),
|
|
174
|
+
* not from raw sessionStorage, so we must use the same storage path here.
|
|
175
|
+
*/
|
|
176
|
+
const handleAuthId = async (authId) => {
|
|
177
|
+
if (authId) try {
|
|
178
|
+
await (await getStorageManager())?.setHybridDataParameter?.("authId", authId);
|
|
179
|
+
} catch {
|
|
180
|
+
__thunderid_browser.logger.warn("Failed to store authId in hybrid storage.");
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Clean up OAuth-related URL parameters from the browser URL.
|
|
185
|
+
*/
|
|
186
|
+
const cleanupOAuthUrlParams = (includeNonce = false) => {
|
|
187
|
+
if (!window?.location?.href) return;
|
|
188
|
+
const url = new URL(window.location.href);
|
|
189
|
+
url.searchParams.delete("error");
|
|
190
|
+
url.searchParams.delete("error_description");
|
|
191
|
+
url.searchParams.delete("code");
|
|
192
|
+
url.searchParams.delete("state");
|
|
193
|
+
if (includeNonce) url.searchParams.delete("nonce");
|
|
194
|
+
window?.history?.replaceState({}, "", url.toString());
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Clean up flow-related URL parameters (executionId, authId) from the browser URL.
|
|
198
|
+
* Used after executionId is set in state to prevent using invalidated executionId from URL.
|
|
199
|
+
*/
|
|
200
|
+
const cleanupFlowUrlParams = () => {
|
|
201
|
+
if (!window?.location?.href) return;
|
|
202
|
+
const url = new URL(window.location.href);
|
|
203
|
+
url.searchParams.delete("executionId");
|
|
204
|
+
url.searchParams.delete("authId");
|
|
205
|
+
url.searchParams.delete("applicationId");
|
|
206
|
+
window?.history?.replaceState({}, "", url.toString());
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Set error state and call onError callback.
|
|
210
|
+
* Ensures isFlowInitialized is true so errors can be displayed in the UI.
|
|
211
|
+
*/
|
|
212
|
+
const setError = (error) => {
|
|
213
|
+
setFlowError(error);
|
|
214
|
+
setIsFlowInitialized(true);
|
|
215
|
+
onError?.(error);
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Handle OAuth error from URL parameters.
|
|
219
|
+
* Clears flow state, creates error, and cleans up URL.
|
|
220
|
+
*/
|
|
221
|
+
const handleOAuthError = (error, errorDescription) => {
|
|
222
|
+
clearFlowState();
|
|
223
|
+
setError(new __thunderid_browser.ThunderIDRuntimeError(errorDescription || `OAuth error: ${error}`, "SIGN_IN_ERROR", "react"));
|
|
224
|
+
cleanupOAuthUrlParams(true);
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* Handle REDIRECTION response by storing flow state and redirecting to OAuth provider.
|
|
228
|
+
*/
|
|
229
|
+
const handleRedirection = async (response) => {
|
|
230
|
+
if (response.type === __thunderid_browser.EmbeddedSignInFlowType.Redirection) {
|
|
231
|
+
const redirectURL = response.data?.redirectURL || response?.redirectURL;
|
|
232
|
+
if (redirectURL && window?.location) {
|
|
233
|
+
if (response.executionId) setExecutionId(response.executionId);
|
|
234
|
+
await setChallengeToken(response.challengeToken ?? null);
|
|
235
|
+
await handleAuthId(getUrlParams().authId);
|
|
236
|
+
require_oauth.initiateOAuthRedirect(redirectURL);
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return false;
|
|
241
|
+
};
|
|
38
242
|
/**
|
|
39
243
|
* Initialize the authentication flow.
|
|
244
|
+
* Priority: executionId > applicationId (from context) > applicationId (from URL)
|
|
245
|
+
*/
|
|
246
|
+
const initializeFlow = async () => {
|
|
247
|
+
const urlParams = getUrlParams();
|
|
248
|
+
oauthCodeProcessedRef.current = false;
|
|
249
|
+
setServerFieldErrors(null);
|
|
250
|
+
await handleAuthId(urlParams.authId);
|
|
251
|
+
const effectiveApplicationId = applicationId || urlParams.applicationId;
|
|
252
|
+
const storedExecutionId = !urlParams.executionId ? sessionStorage.getItem("thunderid_execution_id") : null;
|
|
253
|
+
const resumeExecutionId = urlParams.executionId || storedExecutionId;
|
|
254
|
+
if (!resumeExecutionId && !effectiveApplicationId) {
|
|
255
|
+
const error = new __thunderid_browser.ThunderIDRuntimeError("Either executionId or applicationId is required for authentication", "SIGN_IN_ERROR", "react");
|
|
256
|
+
setError(error);
|
|
257
|
+
throw error;
|
|
258
|
+
}
|
|
259
|
+
try {
|
|
260
|
+
setFlowError(null);
|
|
261
|
+
let response;
|
|
262
|
+
if (resumeExecutionId) try {
|
|
263
|
+
response = await signIn({
|
|
264
|
+
executionId: resumeExecutionId,
|
|
265
|
+
...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {}
|
|
266
|
+
});
|
|
267
|
+
} catch (resumeError) {
|
|
268
|
+
if (storedExecutionId && resumeExecutionId === storedExecutionId && resumeError instanceof __thunderid_browser.ThunderIDAPIError && resumeError.statusCode === 400) {
|
|
269
|
+
setExecutionId(null);
|
|
270
|
+
try {
|
|
271
|
+
await (await getStorageManager())?.removeHybridDataParameter?.("authId");
|
|
272
|
+
} catch {
|
|
273
|
+
__thunderid_browser.logger.warn("Failed to clear authId from hybrid storage.");
|
|
274
|
+
}
|
|
275
|
+
if (!effectiveApplicationId) {
|
|
276
|
+
setError(new __thunderid_browser.ThunderIDRuntimeError(t("errors.signin.session.expired") || "Your session has expired. Please return to the application and sign in again.", "SIGN_IN_ERROR", "react"));
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
response = await signIn({
|
|
280
|
+
applicationId: effectiveApplicationId,
|
|
281
|
+
flowType: __thunderid_browser.EmbeddedFlowType.Authentication,
|
|
282
|
+
...scopes && { scopes }
|
|
283
|
+
});
|
|
284
|
+
} else throw resumeError;
|
|
285
|
+
}
|
|
286
|
+
else response = await signIn({
|
|
287
|
+
applicationId: effectiveApplicationId,
|
|
288
|
+
flowType: __thunderid_browser.EmbeddedFlowType.Authentication,
|
|
289
|
+
...scopes && { scopes }
|
|
290
|
+
});
|
|
291
|
+
if (await handleRedirection(response)) return;
|
|
292
|
+
const { executionId: normalizedExecutionId, components: normalizedComponents, additionalData: normalizedAdditionalData } = require_flowTransformer.normalizeFlowResponse(response, t, { resolveTranslations: false }, meta);
|
|
293
|
+
await setChallengeToken(response.challengeToken ?? null);
|
|
294
|
+
if (normalizedExecutionId && normalizedComponents) {
|
|
295
|
+
setExecutionId(normalizedExecutionId);
|
|
296
|
+
setComponents(normalizedComponents);
|
|
297
|
+
setAdditionalData(normalizedAdditionalData ?? {});
|
|
298
|
+
setIsFlowInitialized(true);
|
|
299
|
+
setIsTimeoutDisabled(false);
|
|
300
|
+
cleanupFlowUrlParams();
|
|
301
|
+
}
|
|
302
|
+
} catch (error) {
|
|
303
|
+
const err = error;
|
|
304
|
+
await clearFlowState();
|
|
305
|
+
setError(err instanceof __thunderid_browser.ThunderIDRuntimeError ? err : new Error(require_flowTransformer.extractErrorMessage(err, t)));
|
|
306
|
+
initializationAttemptedRef.current = false;
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Initialize the flow and handle cleanup of stale flow state.
|
|
40
311
|
*/
|
|
41
|
-
|
|
312
|
+
(0, react.useEffect)(() => {
|
|
313
|
+
const urlParams = getUrlParams();
|
|
314
|
+
if (urlParams.error) {
|
|
315
|
+
handleOAuthError(urlParams.error, urlParams.errorDescription);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
handleAuthId(urlParams.authId);
|
|
319
|
+
}, []);
|
|
320
|
+
(0, react.useEffect)(() => {
|
|
321
|
+
const currentUrlParams = getUrlParams();
|
|
322
|
+
if (isInitialized && isStorageReady && !isLoading && !isFlowInitialized && !initializationAttemptedRef.current && !currentExecutionId && !currentUrlParams.code && !currentUrlParams.state && !isSubmitting && !oauthCodeProcessedRef.current) {
|
|
323
|
+
initializationAttemptedRef.current = true;
|
|
324
|
+
initializeFlow();
|
|
325
|
+
}
|
|
326
|
+
}, [
|
|
327
|
+
isInitialized,
|
|
328
|
+
isStorageReady,
|
|
329
|
+
isLoading,
|
|
330
|
+
isFlowInitialized,
|
|
331
|
+
currentExecutionId
|
|
332
|
+
]);
|
|
42
333
|
/**
|
|
43
|
-
* Handle
|
|
334
|
+
* Handle step timeout if configured in additionalData.
|
|
44
335
|
*/
|
|
45
|
-
|
|
336
|
+
(0, react.useEffect)(() => {
|
|
337
|
+
const timeoutMs = Number(additionalData?.["stepTimeout"]) || 0;
|
|
338
|
+
if (timeoutMs <= 0 || !isFlowInitialized) {
|
|
339
|
+
setIsTimeoutDisabled(false);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const remaining = Math.max(0, Math.floor((timeoutMs - Date.now()) / 1e3));
|
|
343
|
+
const handleTimeout = () => {
|
|
344
|
+
const errorMessage = t("errors.signin.timeout") || "Time allowed to complete the step has expired.";
|
|
345
|
+
setError(new Error(errorMessage));
|
|
346
|
+
setIsTimeoutDisabled(true);
|
|
347
|
+
};
|
|
348
|
+
if (remaining <= 0) {
|
|
349
|
+
handleTimeout();
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const timerId = setTimeout(() => {
|
|
353
|
+
handleTimeout();
|
|
354
|
+
}, remaining * 1e3);
|
|
355
|
+
return () => clearTimeout(timerId);
|
|
356
|
+
}, [
|
|
357
|
+
additionalData?.["stepTimeout"],
|
|
358
|
+
isFlowInitialized,
|
|
359
|
+
t
|
|
360
|
+
]);
|
|
46
361
|
/**
|
|
47
|
-
* Handle
|
|
362
|
+
* Handle form submission from BaseSignIn or render props.
|
|
48
363
|
*/
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
364
|
+
const handleSubmit = async (payload) => {
|
|
365
|
+
const effectiveExecutionId = payload.executionId || currentExecutionId;
|
|
366
|
+
if (!effectiveExecutionId) throw new Error("No active flow ID");
|
|
367
|
+
const processedInputs = { ...payload.inputs };
|
|
368
|
+
if (additionalData?.["consentPrompt"]) try {
|
|
369
|
+
const consentPromptRawData = additionalData["consentPrompt"];
|
|
370
|
+
const purposes = typeof consentPromptRawData === "string" ? JSON.parse(consentPromptRawData) : consentPromptRawData.purposes || consentPromptRawData;
|
|
371
|
+
let isDeny = false;
|
|
372
|
+
if (payload.action) {
|
|
373
|
+
const findAction = (comps) => {
|
|
374
|
+
if (!comps || comps.length === 0) return null;
|
|
375
|
+
const found = comps.find((c) => c.id === payload.action);
|
|
376
|
+
if (found) return found;
|
|
377
|
+
return comps.reduce((acc, c) => {
|
|
378
|
+
if (acc) return acc;
|
|
379
|
+
if (c.components) return findAction(c.components);
|
|
380
|
+
return null;
|
|
381
|
+
}, null);
|
|
382
|
+
};
|
|
383
|
+
const submitAction = findAction(components);
|
|
384
|
+
if (submitAction && submitAction.variant?.toLowerCase() !== "primary") isDeny = true;
|
|
385
|
+
}
|
|
386
|
+
const decisions = { purposes: purposes.map((p) => ({
|
|
387
|
+
approved: !isDeny,
|
|
388
|
+
elements: [...(p.essential || []).map((e) => ({
|
|
389
|
+
approved: !isDeny,
|
|
390
|
+
name: e.name
|
|
391
|
+
})), ...(p.optional || []).map((e) => {
|
|
392
|
+
const key = `__consent_opt__${p.purposeId}__${e.name}`;
|
|
393
|
+
return {
|
|
394
|
+
approved: isDeny ? false : processedInputs[key] !== "false",
|
|
395
|
+
name: e.name
|
|
396
|
+
};
|
|
397
|
+
})],
|
|
398
|
+
purposeName: p.purposeName
|
|
399
|
+
})) };
|
|
400
|
+
processedInputs["consent_decisions"] = JSON.stringify(decisions);
|
|
401
|
+
Object.keys(processedInputs).forEach((key) => {
|
|
402
|
+
if (key.startsWith("__consent_opt__")) delete processedInputs[key];
|
|
54
403
|
});
|
|
55
|
-
|
|
404
|
+
} catch (e) {}
|
|
405
|
+
try {
|
|
406
|
+
setIsSubmitting(true);
|
|
407
|
+
setFlowError(null);
|
|
408
|
+
setServerFieldErrors(null);
|
|
409
|
+
const response = await signIn({
|
|
410
|
+
executionId: effectiveExecutionId,
|
|
411
|
+
...payload,
|
|
412
|
+
inputs: processedInputs,
|
|
413
|
+
...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {}
|
|
414
|
+
});
|
|
415
|
+
if (await handleRedirection(response)) return;
|
|
416
|
+
if (response.data?.additionalData?.["passkeyChallenge"] || response.data?.additionalData?.["passkeyCreationOptions"]) {
|
|
417
|
+
const { passkeyChallenge, passkeyCreationOptions } = response.data.additionalData;
|
|
418
|
+
const effectiveExecutionIdForPasskey = response.executionId || effectiveExecutionId;
|
|
419
|
+
passkeyProcessedRef.current = false;
|
|
420
|
+
await setChallengeToken(response.challengeToken ?? null);
|
|
421
|
+
setPasskeyState({
|
|
422
|
+
actionId: "submit",
|
|
423
|
+
challenge: passkeyChallenge,
|
|
424
|
+
creationOptions: passkeyCreationOptions,
|
|
425
|
+
error: null,
|
|
426
|
+
executionId: effectiveExecutionIdForPasskey,
|
|
427
|
+
isActive: true
|
|
428
|
+
});
|
|
429
|
+
setIsSubmitting(false);
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
const { executionId: normalizedExecutionId, components: normalizedComponents, additionalData: normalizedAdditionalData } = require_flowTransformer.normalizeFlowResponse(response, t, { resolveTranslations: false }, meta);
|
|
433
|
+
if (response.flowStatus === __thunderid_browser.EmbeddedSignInFlowStatus.Error) {
|
|
434
|
+
await clearFlowState();
|
|
435
|
+
const err = new Error(require_flowTransformer.extractErrorMessage(response, t));
|
|
436
|
+
setError(err);
|
|
437
|
+
cleanupFlowUrlParams();
|
|
438
|
+
throw err;
|
|
439
|
+
}
|
|
440
|
+
if (response.flowStatus === __thunderid_browser.EmbeddedSignInFlowStatus.Complete) {
|
|
441
|
+
const finalRedirectUrl = response?.redirectUrl || response?.redirect_uri || afterSignInUrl;
|
|
442
|
+
setIsSubmitting(false);
|
|
443
|
+
setExecutionId(null);
|
|
444
|
+
await setChallengeToken(null);
|
|
445
|
+
setIsFlowInitialized(false);
|
|
446
|
+
sessionStorage.removeItem("thunderid_execution_id");
|
|
447
|
+
try {
|
|
448
|
+
await (await getStorageManager())?.removeHybridDataParameter?.("authId");
|
|
449
|
+
} catch {
|
|
450
|
+
__thunderid_browser.logger.warn("Failed to clear authId from hybrid storage after completion.");
|
|
451
|
+
}
|
|
452
|
+
cleanupOAuthUrlParams(true);
|
|
453
|
+
if (onSuccess) onSuccess({
|
|
454
|
+
redirectUrl: finalRedirectUrl,
|
|
455
|
+
...response.data || {}
|
|
456
|
+
});
|
|
457
|
+
if (finalRedirectUrl && window?.location) window.location.href = finalRedirectUrl;
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
await setChallengeToken(response.challengeToken ?? null);
|
|
461
|
+
if (normalizedExecutionId && normalizedComponents) {
|
|
462
|
+
setExecutionId(normalizedExecutionId);
|
|
463
|
+
setComponents(normalizedComponents);
|
|
464
|
+
setAdditionalData(normalizedAdditionalData ?? {});
|
|
465
|
+
setIsTimeoutDisabled(false);
|
|
466
|
+
setIsFlowInitialized(true);
|
|
467
|
+
cleanupFlowUrlParams();
|
|
468
|
+
const responseFieldErrors = response.data?.fieldErrors;
|
|
469
|
+
if (responseFieldErrors && responseFieldErrors.length > 0) setServerFieldErrors(responseFieldErrors);
|
|
470
|
+
if (response?.error) setFlowError(new Error(require_flowTransformer.extractErrorMessage(response, t)));
|
|
471
|
+
}
|
|
472
|
+
} catch (error) {
|
|
473
|
+
const err = error;
|
|
474
|
+
await clearFlowState();
|
|
475
|
+
setError(err instanceof __thunderid_browser.ThunderIDRuntimeError ? err : new Error(require_flowTransformer.extractErrorMessage(err, t)));
|
|
476
|
+
return;
|
|
477
|
+
} finally {
|
|
478
|
+
setIsSubmitting(false);
|
|
56
479
|
}
|
|
57
480
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
481
|
+
/**
|
|
482
|
+
* Handle authentication errors.
|
|
483
|
+
*/
|
|
484
|
+
const handleError = (error) => {
|
|
485
|
+
setError(error);
|
|
486
|
+
};
|
|
487
|
+
require_useOAuthCallback.useOAuthCallback({
|
|
488
|
+
currentExecutionId,
|
|
489
|
+
isInitialized: isInitialized && !isLoading && isStorageReady,
|
|
490
|
+
isSubmitting,
|
|
491
|
+
onError: (err) => {
|
|
492
|
+
clearFlowState();
|
|
493
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
494
|
+
},
|
|
495
|
+
onSubmit: async (payload) => handleSubmit({
|
|
496
|
+
executionId: payload.executionId,
|
|
497
|
+
inputs: payload.inputs
|
|
498
|
+
}),
|
|
499
|
+
processedRef: oauthCodeProcessedRef,
|
|
500
|
+
setExecutionId
|
|
66
501
|
});
|
|
502
|
+
/**
|
|
503
|
+
* Handle passkey authentication/registration when passkey state becomes active.
|
|
504
|
+
* This effect auto-triggers the browser passkey popup and submits the result.
|
|
505
|
+
*/
|
|
506
|
+
(0, react.useEffect)(() => {
|
|
507
|
+
if (!passkeyState.isActive || !passkeyState.challenge && !passkeyState.creationOptions || !passkeyState.executionId) return;
|
|
508
|
+
if (passkeyProcessedRef.current) return;
|
|
509
|
+
passkeyProcessedRef.current = true;
|
|
510
|
+
const performPasskeyProcess = async () => {
|
|
511
|
+
let inputs;
|
|
512
|
+
if (passkeyState.challenge) {
|
|
513
|
+
const passkeyResponse = await require_passkey.handlePasskeyAuthentication(passkeyState.challenge);
|
|
514
|
+
const passkeyResponseObj = JSON.parse(passkeyResponse);
|
|
515
|
+
inputs = {
|
|
516
|
+
authenticatorData: passkeyResponseObj.response.authenticatorData,
|
|
517
|
+
clientDataJSON: passkeyResponseObj.response.clientDataJSON,
|
|
518
|
+
credentialId: passkeyResponseObj.id,
|
|
519
|
+
signature: passkeyResponseObj.response.signature,
|
|
520
|
+
userHandle: passkeyResponseObj.response.userHandle
|
|
521
|
+
};
|
|
522
|
+
} else if (passkeyState.creationOptions) {
|
|
523
|
+
const passkeyResponse = await require_passkey.handlePasskeyRegistration(passkeyState.creationOptions);
|
|
524
|
+
const passkeyResponseObj = JSON.parse(passkeyResponse);
|
|
525
|
+
inputs = {
|
|
526
|
+
attestationObject: passkeyResponseObj.response.attestationObject,
|
|
527
|
+
clientDataJSON: passkeyResponseObj.response.clientDataJSON,
|
|
528
|
+
credentialId: passkeyResponseObj.id
|
|
529
|
+
};
|
|
530
|
+
} else throw new Error("No passkey challenge or creation options available");
|
|
531
|
+
await handleSubmit({
|
|
532
|
+
executionId: passkeyState.executionId ?? void 0,
|
|
533
|
+
inputs
|
|
534
|
+
});
|
|
535
|
+
};
|
|
536
|
+
performPasskeyProcess().then(() => {
|
|
537
|
+
setPasskeyState({
|
|
538
|
+
actionId: null,
|
|
539
|
+
challenge: null,
|
|
540
|
+
creationOptions: null,
|
|
541
|
+
error: null,
|
|
542
|
+
executionId: null,
|
|
543
|
+
isActive: false
|
|
544
|
+
});
|
|
545
|
+
}).catch((error) => {
|
|
546
|
+
setPasskeyState((prev) => ({
|
|
547
|
+
...prev,
|
|
548
|
+
error,
|
|
549
|
+
isActive: false
|
|
550
|
+
}));
|
|
551
|
+
setFlowError(error);
|
|
552
|
+
onError?.(error);
|
|
553
|
+
});
|
|
554
|
+
}, [
|
|
555
|
+
passkeyState.isActive,
|
|
556
|
+
passkeyState.challenge,
|
|
557
|
+
passkeyState.creationOptions,
|
|
558
|
+
passkeyState.executionId
|
|
559
|
+
]);
|
|
560
|
+
if (children) {
|
|
561
|
+
const renderPropFieldErrors = {};
|
|
562
|
+
if (serverFieldErrors) {
|
|
563
|
+
for (const fe of serverFieldErrors) if (!(fe.identifier in renderPropFieldErrors)) renderPropFieldErrors[fe.identifier] = fe.message;
|
|
564
|
+
}
|
|
565
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children({
|
|
566
|
+
additionalData,
|
|
567
|
+
components,
|
|
568
|
+
error: flowError,
|
|
569
|
+
fieldErrors: renderPropFieldErrors,
|
|
570
|
+
initialize: initializeFlow,
|
|
571
|
+
isInitialized: isFlowInitialized,
|
|
572
|
+
isLoading: isLoading || isSubmitting || !isInitialized,
|
|
573
|
+
isTimeoutDisabled,
|
|
574
|
+
meta,
|
|
575
|
+
onSubmit: handleSubmit
|
|
576
|
+
}) });
|
|
577
|
+
}
|
|
67
578
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_BaseSignIn.default, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
579
|
+
additionalData,
|
|
580
|
+
components,
|
|
581
|
+
isLoading: isLoading || !isInitialized || !isFlowInitialized,
|
|
582
|
+
isTimeoutDisabled,
|
|
583
|
+
onSubmit: handleSubmit,
|
|
584
|
+
onError: handleError,
|
|
585
|
+
error: flowError,
|
|
73
586
|
className,
|
|
74
587
|
size,
|
|
75
|
-
|
|
76
|
-
showSubtitle: true,
|
|
77
|
-
showTitle: true,
|
|
588
|
+
variant,
|
|
78
589
|
preferences,
|
|
79
|
-
|
|
590
|
+
serverFieldErrors
|
|
80
591
|
});
|
|
81
592
|
};
|
|
82
|
-
var SignIn_default
|
|
593
|
+
var SignIn_default = SignIn;
|
|
83
594
|
|
|
84
595
|
//#endregion
|
|
85
|
-
exports.default = SignIn_default
|
|
596
|
+
exports.default = SignIn_default;
|
|
86
597
|
//# sourceMappingURL=SignIn.cjs.map
|