@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,729 +0,0 @@
|
|
|
1
|
-
import FlowProvider_default from "../../../../../contexts/Flow/FlowProvider.js";
|
|
2
|
-
import useFlow_default from "../../../../../contexts/Flow/useFlow.js";
|
|
3
|
-
import useTheme_default from "../../../../../contexts/Theme/useTheme.js";
|
|
4
|
-
import useTranslation_default from "../../../../../hooks/useTranslation.js";
|
|
5
|
-
import { useForm } from "../../../../../hooks/useForm.js";
|
|
6
|
-
import Spinner_default from "../../../../primitives/Spinner/Spinner.js";
|
|
7
|
-
import Typography_default from "../../../../primitives/Typography/Typography.js";
|
|
8
|
-
import { createSignInOptionFromAuthenticator } from "./options/SignInOptionFactory.js";
|
|
9
|
-
import Alert_default from "../../../../primitives/Alert/Alert.js";
|
|
10
|
-
import Card_default from "../../../../primitives/Card/Card.js";
|
|
11
|
-
import Divider_default from "../../../../primitives/Divider/Divider.js";
|
|
12
|
-
import Logo_default from "../../../../primitives/Logo/Logo.js";
|
|
13
|
-
import BaseSignIn_styles_default from "../BaseSignIn.styles.js";
|
|
14
|
-
import { ApplicationNativeAuthenticationConstants, EmbeddedSignInFlowAuthenticatorPromptType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStepType, ThunderIDAPIError, createPackageComponentLogger, handleWebAuthnAuthentication, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
15
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
16
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { cx } from "@emotion/css";
|
|
18
|
-
|
|
19
|
-
//#region src/components/presentation/auth/SignIn/v1/BaseSignIn.tsx
|
|
20
|
-
const logger$1 = createPackageComponentLogger("@thunderid/react", "BaseSignIn");
|
|
21
|
-
/**
|
|
22
|
-
* Check if the authenticator is a passkey/FIDO authenticator
|
|
23
|
-
*/
|
|
24
|
-
const isPasskeyAuthenticator = (authenticator) => authenticator.authenticatorId === ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Passkey && authenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.InternalPrompt && authenticator.metadata?.additionalData?.challengeData;
|
|
25
|
-
/**
|
|
26
|
-
* `T3JnYW5pemF0aW9uQXV0aGVudGljYXRvcjpTU08` - OrganizationSSO
|
|
27
|
-
* Currently, `App-Native Authentication` doesn't support organization SSO.
|
|
28
|
-
* Tracker: TODO: Create `product-is` issue for this.
|
|
29
|
-
*/
|
|
30
|
-
const HIDDEN_AUTHENTICATORS = ["T3JnYW5pemF0aW9uQXV0aGVudGljYXRvcjpTU08"];
|
|
31
|
-
/**
|
|
32
|
-
* Internal component that consumes FlowContext and renders the sign-in UI.
|
|
33
|
-
*/
|
|
34
|
-
const BaseSignInContent = ({ afterSignInUrl, onInitialize, isLoading: externalIsLoading, onSubmit, onSuccess, onError, onFlowChange, className = "", inputClassName = "", buttonClassName = "", errorClassName = "", messageClassName = "", size = "medium", variant = "outlined", showTitle = true, showSubtitle = true }) => {
|
|
35
|
-
const { theme } = useTheme_default();
|
|
36
|
-
const { t } = useTranslation_default();
|
|
37
|
-
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages } = useFlow_default();
|
|
38
|
-
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
39
|
-
const [isSignInInitializationRequestLoading, setIsSignInInitializationRequestLoading] = useState(false);
|
|
40
|
-
const [isInitialized, setIsInitialized] = useState(false);
|
|
41
|
-
const [currentFlow, setCurrentFlow] = useState(null);
|
|
42
|
-
const [currentAuthenticator, setCurrentAuthenticator] = useState(null);
|
|
43
|
-
const [error, setError] = useState(null);
|
|
44
|
-
const [messages, setMessages] = useState([]);
|
|
45
|
-
const isLoading = externalIsLoading || isSignInInitializationRequestLoading;
|
|
46
|
-
const reRenderCheckRef = useRef(false);
|
|
47
|
-
const { values: formValues, touched: touchedFields, setValue: setFormValue, setTouched: setFormTouched, validateForm, touchAllFields, reset: resetForm } = useForm({
|
|
48
|
-
fields: currentAuthenticator?.metadata?.params?.map((param) => ({
|
|
49
|
-
initialValue: "",
|
|
50
|
-
name: param.param,
|
|
51
|
-
required: currentAuthenticator.requiredParams.includes(param.param),
|
|
52
|
-
validator: (value) => {
|
|
53
|
-
if (currentAuthenticator.requiredParams.includes(param.param) && (!value || value.trim() === "")) return t("validations.required.field.error");
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
})) || [],
|
|
57
|
-
initialValues: {},
|
|
58
|
-
requiredMessage: t("validations.required.field.error"),
|
|
59
|
-
validateOnBlur: true,
|
|
60
|
-
validateOnChange: false
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Setup form fields based on the current authenticator.
|
|
64
|
-
*/
|
|
65
|
-
const setupFormFields = useCallback((authenticator) => {
|
|
66
|
-
const initialValues = {};
|
|
67
|
-
authenticator.metadata?.params?.forEach((param) => {
|
|
68
|
-
initialValues[param.param] = "";
|
|
69
|
-
});
|
|
70
|
-
resetForm();
|
|
71
|
-
Object.keys(initialValues).forEach((key) => {
|
|
72
|
-
setFormValue(key, initialValues[key]);
|
|
73
|
-
});
|
|
74
|
-
}, [resetForm, setFormValue]);
|
|
75
|
-
/**
|
|
76
|
-
* Check if the response contains a redirection URL and perform the redirect if necessary.
|
|
77
|
-
* @param response - The authentication response
|
|
78
|
-
* @returns true if a redirect was performed, false otherwise
|
|
79
|
-
*/
|
|
80
|
-
const handleRedirectionIfNeeded = (response) => {
|
|
81
|
-
if (response && "nextStep" in response && response.nextStep && response.nextStep.stepType === EmbeddedSignInFlowStepType.AuthenticatorPrompt && response.nextStep.authenticators?.length === 1) {
|
|
82
|
-
const responseAuthenticator = response.nextStep.authenticators[0];
|
|
83
|
-
if (responseAuthenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt && responseAuthenticator.metadata?.additionalData?.redirectUrl) {
|
|
84
|
-
/**
|
|
85
|
-
* Open a popup window to handle redirection prompts
|
|
86
|
-
*/
|
|
87
|
-
const redirectUrl = responseAuthenticator.metadata?.additionalData?.redirectUrl;
|
|
88
|
-
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
89
|
-
if (!popup) {
|
|
90
|
-
logger$1.error("Failed to open popup window");
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Forward declarations for mutually referencing variables.
|
|
95
|
-
* `messageHandler`, `cleanup`, and `popupMonitor` reference each other,
|
|
96
|
-
* so they are declared with `let` first and assigned below.
|
|
97
|
-
*/
|
|
98
|
-
let messageHandler;
|
|
99
|
-
let popupMonitor;
|
|
100
|
-
const cleanup = () => {
|
|
101
|
-
window.removeEventListener("message", messageHandler);
|
|
102
|
-
if (popupMonitor) clearInterval(popupMonitor);
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Add an event listener to the window to capture the message from the popup
|
|
106
|
-
*/
|
|
107
|
-
messageHandler = async function messageEventHandler(event) {
|
|
108
|
-
/**
|
|
109
|
-
* Check if the message is from our popup window
|
|
110
|
-
*/
|
|
111
|
-
if (event.source !== popup) {
|
|
112
|
-
if (event.source !== window && event.source !== window.parent) {}
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Check the origin of the message to ensure it's from a trusted source
|
|
117
|
-
*/
|
|
118
|
-
const expectedOrigin = afterSignInUrl ? new URL(afterSignInUrl).origin : window.location.origin;
|
|
119
|
-
if (event.origin !== expectedOrigin && event.origin !== window.location.origin) return;
|
|
120
|
-
const { code, state } = event.data;
|
|
121
|
-
if (code && state) {
|
|
122
|
-
await onSubmit({
|
|
123
|
-
flowId: currentFlow.flowId,
|
|
124
|
-
selectedAuthenticator: {
|
|
125
|
-
authenticatorId: responseAuthenticator.authenticatorId,
|
|
126
|
-
params: {
|
|
127
|
-
code,
|
|
128
|
-
state
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}, {
|
|
132
|
-
method: currentFlow?.links[0].method,
|
|
133
|
-
url: currentFlow?.links[0].href
|
|
134
|
-
});
|
|
135
|
-
popup.close();
|
|
136
|
-
cleanup();
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
window.addEventListener("message", messageHandler);
|
|
140
|
-
/**
|
|
141
|
-
* Monitor popup for closure and URL changes
|
|
142
|
-
*/
|
|
143
|
-
let hasProcessedCallback = false;
|
|
144
|
-
popupMonitor = setInterval(async () => {
|
|
145
|
-
try {
|
|
146
|
-
if (popup.closed) {
|
|
147
|
-
cleanup();
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (hasProcessedCallback) return;
|
|
151
|
-
try {
|
|
152
|
-
const popupUrl = popup.location.href;
|
|
153
|
-
if (popupUrl && (popupUrl.includes("code=") || popupUrl.includes("error="))) {
|
|
154
|
-
hasProcessedCallback = true;
|
|
155
|
-
const url = new URL(popupUrl);
|
|
156
|
-
const code = url.searchParams.get("code");
|
|
157
|
-
const state = url.searchParams.get("state");
|
|
158
|
-
if (url.searchParams.get("error")) {
|
|
159
|
-
logger$1.error("OAuth error:");
|
|
160
|
-
popup.close();
|
|
161
|
-
cleanup();
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
if (code && state) {
|
|
165
|
-
const submitResponse = await onSubmit({
|
|
166
|
-
flowId: currentFlow.flowId,
|
|
167
|
-
selectedAuthenticator: {
|
|
168
|
-
authenticatorId: responseAuthenticator.authenticatorId,
|
|
169
|
-
params: {
|
|
170
|
-
code,
|
|
171
|
-
state
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}, {
|
|
175
|
-
method: currentFlow?.links[0].method,
|
|
176
|
-
url: currentFlow?.links[0].href
|
|
177
|
-
});
|
|
178
|
-
popup.close();
|
|
179
|
-
onFlowChange?.(submitResponse);
|
|
180
|
-
if (submitResponse?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) onSuccess?.(submitResponse.authData);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
} catch (e) {}
|
|
184
|
-
} catch (e) {
|
|
185
|
-
logger$1.error("Error monitoring popup:");
|
|
186
|
-
}
|
|
187
|
-
}, 1e3);
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return false;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Handle form submission.
|
|
195
|
-
*/
|
|
196
|
-
const handleSubmit = async (submittedValues) => {
|
|
197
|
-
if (!currentFlow || !currentAuthenticator) return;
|
|
198
|
-
touchAllFields();
|
|
199
|
-
if (!validateForm().isValid) return;
|
|
200
|
-
setIsSignInInitializationRequestLoading(true);
|
|
201
|
-
setError(null);
|
|
202
|
-
setMessages([]);
|
|
203
|
-
try {
|
|
204
|
-
const response = await onSubmit({
|
|
205
|
-
flowId: currentFlow.flowId,
|
|
206
|
-
selectedAuthenticator: {
|
|
207
|
-
authenticatorId: currentAuthenticator.authenticatorId,
|
|
208
|
-
params: submittedValues
|
|
209
|
-
}
|
|
210
|
-
}, {
|
|
211
|
-
method: currentFlow?.links[0].method,
|
|
212
|
-
url: currentFlow?.links[0].href
|
|
213
|
-
});
|
|
214
|
-
onFlowChange?.(response);
|
|
215
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
216
|
-
onSuccess?.(response.authData);
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
220
|
-
setError(t("errors.signin.flow.completion.failure"));
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
if (handleRedirectionIfNeeded(response)) return;
|
|
224
|
-
if (response && "flowId" in response && "nextStep" in response) {
|
|
225
|
-
const nextStepResponse = response;
|
|
226
|
-
setCurrentFlow(nextStepResponse);
|
|
227
|
-
if (nextStepResponse.nextStep?.authenticators?.length > 0) if (nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) setCurrentAuthenticator(null);
|
|
228
|
-
else {
|
|
229
|
-
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
230
|
-
setCurrentAuthenticator(nextAuthenticator);
|
|
231
|
-
setupFormFields(nextAuthenticator);
|
|
232
|
-
}
|
|
233
|
-
if (nextStepResponse.nextStep?.messages) setMessages(nextStepResponse.nextStep.messages.map((msg) => ({
|
|
234
|
-
message: msg.message || "",
|
|
235
|
-
type: msg.type || "INFO"
|
|
236
|
-
})));
|
|
237
|
-
}
|
|
238
|
-
} catch (err) {
|
|
239
|
-
setError(err instanceof ThunderIDAPIError ? err.message : t("errors.signin.flow.failure"));
|
|
240
|
-
onError?.(err);
|
|
241
|
-
} finally {
|
|
242
|
-
setIsSignInInitializationRequestLoading(false);
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
/**
|
|
246
|
-
* Handle authenticator selection for multi-option prompts.
|
|
247
|
-
*/
|
|
248
|
-
const handleAuthenticatorSelection = async (authenticator, formData) => {
|
|
249
|
-
if (!currentFlow) return;
|
|
250
|
-
if (formData) touchAllFields();
|
|
251
|
-
setIsSignInInitializationRequestLoading(true);
|
|
252
|
-
setError(null);
|
|
253
|
-
setMessages([]);
|
|
254
|
-
try {
|
|
255
|
-
if (isPasskeyAuthenticator(authenticator)) try {
|
|
256
|
-
const challengeData = authenticator.metadata?.additionalData?.challengeData;
|
|
257
|
-
if (!challengeData) throw new Error("Missing challenge data for passkey authentication");
|
|
258
|
-
const tokenResponse = await handleWebAuthnAuthentication(challengeData);
|
|
259
|
-
const response = await onSubmit({
|
|
260
|
-
flowId: currentFlow.flowId,
|
|
261
|
-
selectedAuthenticator: {
|
|
262
|
-
authenticatorId: authenticator.authenticatorId,
|
|
263
|
-
params: { tokenResponse }
|
|
264
|
-
}
|
|
265
|
-
}, {
|
|
266
|
-
method: currentFlow?.links[0].method,
|
|
267
|
-
url: currentFlow?.links[0].href
|
|
268
|
-
});
|
|
269
|
-
onFlowChange?.(response);
|
|
270
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
271
|
-
onSuccess?.(response.authData);
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
275
|
-
setError(t("errors.signin.flow.passkeys.completion.failure"));
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
if (response && "flowId" in response && "nextStep" in response) {
|
|
279
|
-
const nextStepResponse = response;
|
|
280
|
-
setCurrentFlow(nextStepResponse);
|
|
281
|
-
if (nextStepResponse.nextStep?.authenticators?.length > 0) if (nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) setCurrentAuthenticator(null);
|
|
282
|
-
else {
|
|
283
|
-
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
284
|
-
if (isPasskeyAuthenticator(nextAuthenticator)) {
|
|
285
|
-
handleAuthenticatorSelection(nextAuthenticator);
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
setCurrentAuthenticator(nextAuthenticator);
|
|
289
|
-
setupFormFields(nextAuthenticator);
|
|
290
|
-
}
|
|
291
|
-
if (nextStepResponse.nextStep?.messages) setMessages(nextStepResponse.nextStep.messages.map((msg) => ({
|
|
292
|
-
message: msg.message || "",
|
|
293
|
-
type: msg.type || "INFO"
|
|
294
|
-
})));
|
|
295
|
-
}
|
|
296
|
-
} catch (passkeyError) {
|
|
297
|
-
logger$1.error("Passkey authentication error:");
|
|
298
|
-
let errorMessage = passkeyError instanceof Error ? passkeyError.message : t("errors.signin.flow.passkeys.failure");
|
|
299
|
-
if (passkeyError instanceof Error && passkeyError.message.includes("security")) errorMessage += " This may be due to browser security settings, an insecure connection, or device restrictions.";
|
|
300
|
-
setError(errorMessage);
|
|
301
|
-
}
|
|
302
|
-
else if (authenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt) {
|
|
303
|
-
const response = await onSubmit({
|
|
304
|
-
flowId: currentFlow.flowId,
|
|
305
|
-
selectedAuthenticator: {
|
|
306
|
-
authenticatorId: authenticator.authenticatorId,
|
|
307
|
-
params: {}
|
|
308
|
-
}
|
|
309
|
-
}, {
|
|
310
|
-
method: currentFlow?.links[0].method,
|
|
311
|
-
url: currentFlow?.links[0].href
|
|
312
|
-
});
|
|
313
|
-
onFlowChange?.(response);
|
|
314
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
315
|
-
onSuccess?.(response.authData);
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (handleRedirectionIfNeeded(response)) {}
|
|
319
|
-
} else if (formData) {
|
|
320
|
-
if (!validateForm().isValid) return;
|
|
321
|
-
const formResponse = await onSubmit({
|
|
322
|
-
flowId: currentFlow.flowId,
|
|
323
|
-
selectedAuthenticator: {
|
|
324
|
-
authenticatorId: authenticator.authenticatorId,
|
|
325
|
-
params: formData
|
|
326
|
-
}
|
|
327
|
-
}, {
|
|
328
|
-
method: currentFlow?.links[0].method,
|
|
329
|
-
url: currentFlow?.links[0].href
|
|
330
|
-
});
|
|
331
|
-
onFlowChange?.(formResponse);
|
|
332
|
-
if (formResponse?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
333
|
-
onSuccess?.(formResponse.authData);
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
if (formResponse?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || formResponse?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
337
|
-
setError("Authentication failed. Please check your credentials and try again.");
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
if (handleRedirectionIfNeeded(formResponse)) return;
|
|
341
|
-
if (formResponse && "flowId" in formResponse && "nextStep" in formResponse) {
|
|
342
|
-
const nextStepResponse = formResponse;
|
|
343
|
-
setCurrentFlow(nextStepResponse);
|
|
344
|
-
if (nextStepResponse.nextStep?.authenticators?.length > 0) if (nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) setCurrentAuthenticator(null);
|
|
345
|
-
else {
|
|
346
|
-
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
347
|
-
if (isPasskeyAuthenticator(nextAuthenticator)) {
|
|
348
|
-
handleAuthenticatorSelection(nextAuthenticator);
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
setCurrentAuthenticator(nextAuthenticator);
|
|
352
|
-
setupFormFields(nextAuthenticator);
|
|
353
|
-
}
|
|
354
|
-
if (nextStepResponse.nextStep?.messages) setMessages(nextStepResponse.nextStep.messages.map((msg) => ({
|
|
355
|
-
message: msg.message || "",
|
|
356
|
-
type: msg.type || "INFO"
|
|
357
|
-
})));
|
|
358
|
-
}
|
|
359
|
-
} else if (!(authenticator.metadata?.params && authenticator.metadata.params.length > 0)) {
|
|
360
|
-
const response = await onSubmit({
|
|
361
|
-
flowId: currentFlow.flowId,
|
|
362
|
-
selectedAuthenticator: {
|
|
363
|
-
authenticatorId: authenticator.authenticatorId,
|
|
364
|
-
params: {}
|
|
365
|
-
}
|
|
366
|
-
}, {
|
|
367
|
-
method: currentFlow?.links[0].method,
|
|
368
|
-
url: currentFlow?.links[0].href
|
|
369
|
-
});
|
|
370
|
-
onFlowChange?.(response);
|
|
371
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
372
|
-
onSuccess?.(response.authData);
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
376
|
-
setError("Authentication failed. Please try again.");
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
if (handleRedirectionIfNeeded(response)) return;
|
|
380
|
-
if (response && "flowId" in response && "nextStep" in response) {
|
|
381
|
-
const nextStepResponse = response;
|
|
382
|
-
setCurrentFlow(nextStepResponse);
|
|
383
|
-
if (nextStepResponse.nextStep?.authenticators?.length > 0) if (nextStepResponse.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) setCurrentAuthenticator(null);
|
|
384
|
-
else {
|
|
385
|
-
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
386
|
-
if (isPasskeyAuthenticator(nextAuthenticator)) {
|
|
387
|
-
handleAuthenticatorSelection(nextAuthenticator);
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
setCurrentAuthenticator(nextAuthenticator);
|
|
391
|
-
setupFormFields(nextAuthenticator);
|
|
392
|
-
}
|
|
393
|
-
if (nextStepResponse.nextStep?.messages) setMessages(nextStepResponse.nextStep.messages.map((msg) => ({
|
|
394
|
-
message: msg.message || "",
|
|
395
|
-
type: msg.type || "INFO"
|
|
396
|
-
})));
|
|
397
|
-
}
|
|
398
|
-
} else {
|
|
399
|
-
setCurrentAuthenticator(authenticator);
|
|
400
|
-
setupFormFields(authenticator);
|
|
401
|
-
}
|
|
402
|
-
} catch (err) {
|
|
403
|
-
setError(err instanceof ThunderIDAPIError ? err?.message : "Authenticator selection failed");
|
|
404
|
-
onError?.(err);
|
|
405
|
-
} finally {
|
|
406
|
-
setIsSignInInitializationRequestLoading(false);
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
/**
|
|
410
|
-
* Handle input value changes.
|
|
411
|
-
*/
|
|
412
|
-
const handleInputChange = (param, value) => {
|
|
413
|
-
setFormValue(param, value);
|
|
414
|
-
setFormTouched(param, true);
|
|
415
|
-
};
|
|
416
|
-
/**
|
|
417
|
-
* Check if current flow has multiple authenticator options.
|
|
418
|
-
*/
|
|
419
|
-
const hasMultipleOptions = useCallback(() => !!(currentFlow && "nextStep" in currentFlow && currentFlow.nextStep?.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt && currentFlow.nextStep?.authenticators && currentFlow.nextStep.authenticators.length > 1), [currentFlow]);
|
|
420
|
-
/**
|
|
421
|
-
* Get available authenticators for selection.
|
|
422
|
-
*/
|
|
423
|
-
const getAvailableAuthenticators = useCallback(() => {
|
|
424
|
-
if (!currentFlow || !("nextStep" in currentFlow) || !currentFlow.nextStep?.authenticators) return [];
|
|
425
|
-
return currentFlow.nextStep.authenticators;
|
|
426
|
-
}, [currentFlow]);
|
|
427
|
-
const containerClasses = cx([
|
|
428
|
-
withVendorCSSClassPrefix("signin"),
|
|
429
|
-
withVendorCSSClassPrefix(`signin--${size}`),
|
|
430
|
-
withVendorCSSClassPrefix(`signin--${variant}`)
|
|
431
|
-
], className);
|
|
432
|
-
const inputClasses = cx([
|
|
433
|
-
withVendorCSSClassPrefix("signin__input"),
|
|
434
|
-
size === "small" && withVendorCSSClassPrefix("signin__input--small"),
|
|
435
|
-
size === "large" && withVendorCSSClassPrefix("signin__input--large")
|
|
436
|
-
], inputClassName);
|
|
437
|
-
const buttonClasses = cx([
|
|
438
|
-
withVendorCSSClassPrefix("signin__button"),
|
|
439
|
-
size === "small" && withVendorCSSClassPrefix("signin__button--small"),
|
|
440
|
-
size === "large" && withVendorCSSClassPrefix("signin__button--large")
|
|
441
|
-
], buttonClassName);
|
|
442
|
-
const errorClasses = cx([withVendorCSSClassPrefix("signin__error")], errorClassName);
|
|
443
|
-
const messageClasses = cx([withVendorCSSClassPrefix("signin__messages")], messageClassName);
|
|
444
|
-
useEffect(() => {
|
|
445
|
-
if (isLoading) return;
|
|
446
|
-
if (reRenderCheckRef.current) return;
|
|
447
|
-
reRenderCheckRef.current = true;
|
|
448
|
-
(async () => {
|
|
449
|
-
setIsSignInInitializationRequestLoading(true);
|
|
450
|
-
setError(null);
|
|
451
|
-
try {
|
|
452
|
-
const response = await onInitialize?.();
|
|
453
|
-
setCurrentFlow(response);
|
|
454
|
-
setIsInitialized(true);
|
|
455
|
-
onFlowChange?.(response);
|
|
456
|
-
if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
457
|
-
onSuccess?.(response.authData || {});
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
if (response?.nextStep?.authenticators?.length > 0) if (response.nextStep.stepType === EmbeddedSignInFlowStepType.MultiOptionsPrompt && response.nextStep.authenticators.length > 1) setCurrentAuthenticator(null);
|
|
461
|
-
else {
|
|
462
|
-
const authenticator = response.nextStep.authenticators[0];
|
|
463
|
-
setCurrentAuthenticator(authenticator);
|
|
464
|
-
setupFormFields(authenticator);
|
|
465
|
-
}
|
|
466
|
-
if (response && "nextStep" in response && response.nextStep && "messages" in response.nextStep) setMessages((response.nextStep.messages || []).map((msg) => ({
|
|
467
|
-
message: msg.message || "",
|
|
468
|
-
type: msg.type || "INFO"
|
|
469
|
-
})));
|
|
470
|
-
} catch (err) {
|
|
471
|
-
setError(err instanceof ThunderIDAPIError ? err.message : t("errors.signin.initialization"));
|
|
472
|
-
onError?.(err);
|
|
473
|
-
} finally {
|
|
474
|
-
setIsSignInInitializationRequestLoading(false);
|
|
475
|
-
}
|
|
476
|
-
})();
|
|
477
|
-
}, [isLoading]);
|
|
478
|
-
if (!isInitialized && isLoading) return /* @__PURE__ */ jsx(Card_default, {
|
|
479
|
-
className: cx(containerClasses, styles["card"]),
|
|
480
|
-
"data-testid": "thunderid-signin",
|
|
481
|
-
variant,
|
|
482
|
-
children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsxs("div", {
|
|
483
|
-
className: styles["loadingContainer"],
|
|
484
|
-
children: [/* @__PURE__ */ jsx(Spinner_default, { size: "medium" }), /* @__PURE__ */ jsx(Typography_default, {
|
|
485
|
-
variant: "body1",
|
|
486
|
-
className: styles["loadingText"],
|
|
487
|
-
children: t("messages.loading.placeholder")
|
|
488
|
-
})]
|
|
489
|
-
}) })
|
|
490
|
-
});
|
|
491
|
-
if (hasMultipleOptions() && !currentAuthenticator) {
|
|
492
|
-
const availableAuthenticators = getAvailableAuthenticators();
|
|
493
|
-
const userPromptAuthenticators = availableAuthenticators.filter((auth) => auth.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.UserPrompt || auth.idp === "LOCAL" && auth.metadata?.params && auth.metadata.params.length > 0);
|
|
494
|
-
const optionAuthenticators = availableAuthenticators.filter((auth) => !userPromptAuthenticators.includes(auth)).filter((authenticator) => !HIDDEN_AUTHENTICATORS.includes(authenticator.authenticatorId));
|
|
495
|
-
return /* @__PURE__ */ jsxs(Card_default, {
|
|
496
|
-
className: cx(containerClasses, styles["card"]),
|
|
497
|
-
"data-testid": "thunderid-signin",
|
|
498
|
-
variant,
|
|
499
|
-
children: [(showTitle || showSubtitle) && /* @__PURE__ */ jsxs(Card_default.Header, {
|
|
500
|
-
className: styles["header"],
|
|
501
|
-
children: [showTitle && /* @__PURE__ */ jsx(Card_default.Title, {
|
|
502
|
-
level: 2,
|
|
503
|
-
className: styles["title"],
|
|
504
|
-
children: flowTitle || t("signin.heading")
|
|
505
|
-
}), showSubtitle && /* @__PURE__ */ jsx(Typography_default, {
|
|
506
|
-
variant: "body1",
|
|
507
|
-
className: styles["subtitle"],
|
|
508
|
-
children: flowSubtitle || t("signin.subheading")
|
|
509
|
-
})]
|
|
510
|
-
}), /* @__PURE__ */ jsxs(Card_default.Content, { children: [
|
|
511
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
512
|
-
className: styles["flowMessagesContainer"],
|
|
513
|
-
children: flowMessages.map((flowMessage, index) => /* @__PURE__ */ jsx(Alert_default, {
|
|
514
|
-
variant: flowMessage.type,
|
|
515
|
-
className: cx(styles["flowMessageItem"], messageClasses),
|
|
516
|
-
children: /* @__PURE__ */ jsx(Alert_default.Description, { children: flowMessage.message })
|
|
517
|
-
}, flowMessage.id || index))
|
|
518
|
-
}),
|
|
519
|
-
messages.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
520
|
-
className: styles["messagesContainer"],
|
|
521
|
-
children: messages.map((message, index) => {
|
|
522
|
-
let messageVariant;
|
|
523
|
-
const lowerType = message.type.toLowerCase();
|
|
524
|
-
if (lowerType === "error") messageVariant = "error";
|
|
525
|
-
else if (lowerType === "warning") messageVariant = "warning";
|
|
526
|
-
else if (lowerType === "success") messageVariant = "success";
|
|
527
|
-
else messageVariant = "info";
|
|
528
|
-
return /* @__PURE__ */ jsx(Alert_default, {
|
|
529
|
-
variant: messageVariant,
|
|
530
|
-
className: cx(styles["messageItem"], messageClasses),
|
|
531
|
-
children: /* @__PURE__ */ jsx(Alert_default.Description, { children: message.message })
|
|
532
|
-
}, index);
|
|
533
|
-
})
|
|
534
|
-
}),
|
|
535
|
-
error && /* @__PURE__ */ jsxs(Alert_default, {
|
|
536
|
-
variant: "error",
|
|
537
|
-
className: cx(styles["errorContainer"], errorClasses),
|
|
538
|
-
children: [/* @__PURE__ */ jsx(Alert_default.Title, { children: "Error" }), /* @__PURE__ */ jsx(Alert_default.Description, { children: error })]
|
|
539
|
-
}),
|
|
540
|
-
/* @__PURE__ */ jsxs("div", {
|
|
541
|
-
className: styles["contentContainer"],
|
|
542
|
-
children: [
|
|
543
|
-
userPromptAuthenticators.map((authenticator, index) => /* @__PURE__ */ jsxs("div", {
|
|
544
|
-
className: styles["authenticatorItem"],
|
|
545
|
-
children: [index > 0 && /* @__PURE__ */ jsx(Divider_default, {
|
|
546
|
-
className: styles["divider"],
|
|
547
|
-
children: "OR"
|
|
548
|
-
}), /* @__PURE__ */ jsx("form", {
|
|
549
|
-
className: styles["form"],
|
|
550
|
-
onSubmit: (e) => {
|
|
551
|
-
e.preventDefault();
|
|
552
|
-
const formData = {};
|
|
553
|
-
authenticator.metadata?.params?.forEach((param) => {
|
|
554
|
-
formData[param.param] = formValues[param.param] || "";
|
|
555
|
-
});
|
|
556
|
-
handleAuthenticatorSelection(authenticator, formData);
|
|
557
|
-
},
|
|
558
|
-
children: createSignInOptionFromAuthenticator(authenticator, formValues, touchedFields, isLoading, handleInputChange, (auth, formData) => handleAuthenticatorSelection(auth, formData), {
|
|
559
|
-
buttonClassName: buttonClasses,
|
|
560
|
-
error,
|
|
561
|
-
inputClassName: inputClasses
|
|
562
|
-
})
|
|
563
|
-
})]
|
|
564
|
-
}, authenticator.authenticatorId)),
|
|
565
|
-
userPromptAuthenticators.length > 0 && optionAuthenticators.length > 0 && /* @__PURE__ */ jsx(Divider_default, {
|
|
566
|
-
className: styles["divider"],
|
|
567
|
-
children: "OR"
|
|
568
|
-
}),
|
|
569
|
-
optionAuthenticators.map((authenticator) => /* @__PURE__ */ jsx("div", {
|
|
570
|
-
className: styles["authenticatorItem"],
|
|
571
|
-
children: createSignInOptionFromAuthenticator(authenticator, formValues, touchedFields, isLoading, handleInputChange, (auth, formData) => handleAuthenticatorSelection(auth, formData), {
|
|
572
|
-
buttonClassName: buttonClasses,
|
|
573
|
-
error,
|
|
574
|
-
inputClassName: inputClasses
|
|
575
|
-
})
|
|
576
|
-
}, authenticator.authenticatorId))
|
|
577
|
-
]
|
|
578
|
-
})
|
|
579
|
-
] })]
|
|
580
|
-
});
|
|
581
|
-
}
|
|
582
|
-
if (!currentAuthenticator) return /* @__PURE__ */ jsx(Card_default, {
|
|
583
|
-
className: cx(containerClasses, styles["noAuthenticatorCard"]),
|
|
584
|
-
"data-testid": "thunderid-signin",
|
|
585
|
-
variant,
|
|
586
|
-
children: /* @__PURE__ */ jsx(Card_default.Content, { children: error && /* @__PURE__ */ jsxs(Alert_default, {
|
|
587
|
-
variant: "error",
|
|
588
|
-
className: styles["errorAlert"],
|
|
589
|
-
children: [/* @__PURE__ */ jsx(Alert_default.Title, { children: t("errors.heading") || "Error" }), /* @__PURE__ */ jsx(Alert_default.Description, { children: error })]
|
|
590
|
-
}) })
|
|
591
|
-
});
|
|
592
|
-
if (isPasskeyAuthenticator(currentAuthenticator) && !isLoading) {
|
|
593
|
-
useEffect(() => {
|
|
594
|
-
handleAuthenticatorSelection(currentAuthenticator);
|
|
595
|
-
}, [currentAuthenticator]);
|
|
596
|
-
return /* @__PURE__ */ jsx(Card_default, {
|
|
597
|
-
className: cx(containerClasses, styles["card"]),
|
|
598
|
-
"data-testid": "thunderid-signin",
|
|
599
|
-
variant,
|
|
600
|
-
children: /* @__PURE__ */ jsx(Card_default.Content, { children: /* @__PURE__ */ jsxs("div", {
|
|
601
|
-
className: styles["centeredContainer"],
|
|
602
|
-
children: [
|
|
603
|
-
/* @__PURE__ */ jsx("div", {
|
|
604
|
-
className: styles["passkeyContainer"],
|
|
605
|
-
children: /* @__PURE__ */ jsx(Spinner_default, { size: "large" })
|
|
606
|
-
}),
|
|
607
|
-
/* @__PURE__ */ jsx(Typography_default, {
|
|
608
|
-
variant: "body1",
|
|
609
|
-
children: t("passkey.authenticating") || "Authenticating with passkey..."
|
|
610
|
-
}),
|
|
611
|
-
/* @__PURE__ */ jsx(Typography_default, {
|
|
612
|
-
variant: "body2",
|
|
613
|
-
className: styles["passkeyText"],
|
|
614
|
-
children: t("passkey.instruction") || "Please use your fingerprint, face, or security key to authenticate."
|
|
615
|
-
})
|
|
616
|
-
]
|
|
617
|
-
}) })
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
return /* @__PURE__ */ jsxs(Card_default, {
|
|
621
|
-
className: cx(containerClasses, styles["card"]),
|
|
622
|
-
"data-testid": "thunderid-signin",
|
|
623
|
-
variant,
|
|
624
|
-
children: [/* @__PURE__ */ jsxs(Card_default.Header, {
|
|
625
|
-
className: styles["header"],
|
|
626
|
-
children: [
|
|
627
|
-
/* @__PURE__ */ jsx(Card_default.Title, {
|
|
628
|
-
level: 2,
|
|
629
|
-
className: styles["title"],
|
|
630
|
-
children: flowTitle || t("signin.heading")
|
|
631
|
-
}),
|
|
632
|
-
/* @__PURE__ */ jsx(Typography_default, {
|
|
633
|
-
variant: "body1",
|
|
634
|
-
className: styles["subtitle"],
|
|
635
|
-
children: flowSubtitle || t("signin.subheading")
|
|
636
|
-
}),
|
|
637
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
638
|
-
className: styles["flowMessagesContainer"],
|
|
639
|
-
children: flowMessages.map((flowMessage, index) => /* @__PURE__ */ jsx(Alert_default, {
|
|
640
|
-
variant: flowMessage.type,
|
|
641
|
-
className: cx(styles["flowMessageItem"], messageClasses),
|
|
642
|
-
children: /* @__PURE__ */ jsx(Alert_default.Description, { children: flowMessage.message })
|
|
643
|
-
}, flowMessage.id || index))
|
|
644
|
-
}),
|
|
645
|
-
messages.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
646
|
-
className: styles["messagesContainer"],
|
|
647
|
-
children: messages.map((message, index) => {
|
|
648
|
-
return /* @__PURE__ */ jsx(Alert_default, {
|
|
649
|
-
variant: {
|
|
650
|
-
error: "error",
|
|
651
|
-
success: "success",
|
|
652
|
-
warning: "warning"
|
|
653
|
-
}[message.type.toLowerCase()] || "info",
|
|
654
|
-
className: cx(styles["messageItem"], messageClasses),
|
|
655
|
-
children: /* @__PURE__ */ jsx(Alert_default.Description, { children: message.message })
|
|
656
|
-
}, index);
|
|
657
|
-
})
|
|
658
|
-
})
|
|
659
|
-
]
|
|
660
|
-
}), /* @__PURE__ */ jsxs(Card_default.Content, { children: [error && /* @__PURE__ */ jsxs(Alert_default, {
|
|
661
|
-
variant: "error",
|
|
662
|
-
className: cx(styles["errorContainer"], errorClasses),
|
|
663
|
-
children: [/* @__PURE__ */ jsx(Alert_default.Title, { children: t("errors.heading") }), /* @__PURE__ */ jsx(Alert_default.Description, { children: error })]
|
|
664
|
-
}), /* @__PURE__ */ jsx("form", {
|
|
665
|
-
className: styles["form"],
|
|
666
|
-
onSubmit: (e) => {
|
|
667
|
-
e.preventDefault();
|
|
668
|
-
const formData = {};
|
|
669
|
-
currentAuthenticator.metadata?.params?.forEach((param) => {
|
|
670
|
-
formData[param.param] = formValues[param.param] || "";
|
|
671
|
-
});
|
|
672
|
-
handleSubmit(formData);
|
|
673
|
-
},
|
|
674
|
-
children: createSignInOptionFromAuthenticator(currentAuthenticator, formValues, touchedFields, isLoading, handleInputChange, (authenticator, formData) => handleSubmit(formData || formValues), {
|
|
675
|
-
buttonClassName: buttonClasses,
|
|
676
|
-
error,
|
|
677
|
-
inputClassName: inputClasses
|
|
678
|
-
})
|
|
679
|
-
})] })]
|
|
680
|
-
});
|
|
681
|
-
};
|
|
682
|
-
/**
|
|
683
|
-
* Base SignIn component that provides native authentication flow.
|
|
684
|
-
* This component handles both the presentation layer and authentication flow logic.
|
|
685
|
-
* It accepts API functions as props to maintain framework independence.
|
|
686
|
-
*
|
|
687
|
-
* @example
|
|
688
|
-
* ```tsx
|
|
689
|
-
* import { BaseSignIn } from '@thunderid/react';
|
|
690
|
-
*
|
|
691
|
-
* const MySignIn = () => {
|
|
692
|
-
* return (
|
|
693
|
-
* <BaseSignIn
|
|
694
|
-
* onInitialize={async () => {
|
|
695
|
-
* // Your API call to initialize authentication
|
|
696
|
-
* return await initializeAuth();
|
|
697
|
-
* }}
|
|
698
|
-
* onSubmit={async (payload) => {
|
|
699
|
-
* // Your API call to handle authentication
|
|
700
|
-
* return await handleAuth(payload);
|
|
701
|
-
* }}
|
|
702
|
-
* onSuccess={(authData) => {
|
|
703
|
-
* console.log('Success:', authData);
|
|
704
|
-
* }}
|
|
705
|
-
* onError={(error) => {
|
|
706
|
-
* console.error('Error:', error);
|
|
707
|
-
* }}
|
|
708
|
-
* className="max-w-md mx-auto"
|
|
709
|
-
* />
|
|
710
|
-
* );
|
|
711
|
-
* };
|
|
712
|
-
* ```
|
|
713
|
-
*/
|
|
714
|
-
const BaseSignIn = ({ showLogo = true,...rest }) => {
|
|
715
|
-
const { theme } = useTheme_default();
|
|
716
|
-
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
717
|
-
return /* @__PURE__ */ jsxs("div", { children: [showLogo && /* @__PURE__ */ jsx("div", {
|
|
718
|
-
className: styles["logoContainer"],
|
|
719
|
-
children: /* @__PURE__ */ jsx(Logo_default, { size: "large" })
|
|
720
|
-
}), /* @__PURE__ */ jsx(FlowProvider_default, { children: /* @__PURE__ */ jsx(BaseSignInContent, {
|
|
721
|
-
showLogo,
|
|
722
|
-
...rest
|
|
723
|
-
}) })] });
|
|
724
|
-
};
|
|
725
|
-
var BaseSignIn_default = BaseSignIn;
|
|
726
|
-
|
|
727
|
-
//#endregion
|
|
728
|
-
export { BaseSignIn_default as default };
|
|
729
|
-
//# sourceMappingURL=BaseSignIn.js.map
|