@contember/react-client-tenant 2.1.0-alpha.9 → 2.1.0-beta.2
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/development/index.cjs +80 -80
- package/dist/development/index.js +31 -31
- package/dist/development/src/components/IdentityProvider.cjs +3 -3
- package/dist/development/src/components/IdentityProvider.cjs.map +1 -1
- package/dist/development/src/components/IdentityProvider.js +3 -3
- package/dist/development/src/components/IdentityProvider.js.map +1 -1
- package/dist/development/src/components/IdentityState.cjs.map +1 -1
- package/dist/development/src/components/IdentityState.js.map +1 -1
- package/dist/development/src/components/forms/ChangeMyPasswordForm.cjs.map +1 -1
- package/dist/development/src/components/forms/ChangeMyPasswordForm.js.map +1 -1
- package/dist/development/src/components/forms/CreateApiKeyForm.cjs.map +1 -1
- package/dist/development/src/components/forms/CreateApiKeyForm.js.map +1 -1
- package/dist/development/src/components/forms/CreateSessionTokenForm.cjs.map +1 -1
- package/dist/development/src/components/forms/CreateSessionTokenForm.js.map +1 -1
- package/dist/development/src/components/forms/InviteForm.cjs.map +1 -1
- package/dist/development/src/components/forms/InviteForm.js.map +1 -1
- package/dist/development/src/components/forms/LoginForm.cjs +3 -1
- package/dist/development/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/development/src/components/forms/LoginForm.js +3 -1
- package/dist/development/src/components/forms/LoginForm.js.map +1 -1
- package/dist/development/src/components/forms/OtpConfirmForm.cjs.map +1 -1
- package/dist/development/src/components/forms/OtpConfirmForm.js.map +1 -1
- package/dist/development/src/components/forms/OtpPrepareForm.cjs +1 -1
- package/dist/development/src/components/forms/OtpPrepareForm.cjs.map +1 -1
- package/dist/development/src/components/forms/OtpPrepareForm.js +1 -1
- package/dist/development/src/components/forms/OtpPrepareForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordResetForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordResetForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordResetRequestForm.cjs +1 -1
- package/dist/development/src/components/forms/PasswordResetRequestForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordResetRequestForm.js +2 -2
- package/dist/development/src/components/forms/PasswordResetRequestForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.cjs +3 -3
- package/dist/development/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.js +4 -4
- package/dist/development/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.cjs +6 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.js +7 -2
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.js.map +1 -1
- package/dist/development/src/components/forms/TenantForm.cjs +25 -15
- package/dist/development/src/components/forms/TenantForm.cjs.map +1 -1
- package/dist/development/src/components/forms/TenantForm.js +25 -15
- package/dist/development/src/components/forms/TenantForm.js.map +1 -1
- package/dist/development/src/components/forms/UpdateProjectMemberForm.cjs.map +1 -1
- package/dist/development/src/components/forms/UpdateProjectMemberForm.js.map +1 -1
- package/dist/development/src/components/idp/IDP.cjs +5 -5
- package/dist/development/src/components/idp/IDP.cjs.map +1 -1
- package/dist/development/src/components/idp/IDP.js +5 -5
- package/dist/development/src/components/idp/IDP.js.map +1 -1
- package/dist/development/src/components/idp/IDPInitTrigger.cjs +2 -2
- package/dist/development/src/components/idp/IDPInitTrigger.cjs.map +1 -1
- package/dist/development/src/components/idp/IDPInitTrigger.js +2 -2
- package/dist/development/src/components/idp/IDPInitTrigger.js.map +1 -1
- package/dist/development/src/components/idp/IDPState.cjs.map +1 -1
- package/dist/development/src/components/idp/IDPState.js.map +1 -1
- package/dist/development/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/DisableOtpTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/LogoutTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/LogoutTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.cjs +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.js +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/TenantActionTrigger.cjs +1 -1
- package/dist/development/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/TenantActionTrigger.js +1 -1
- package/dist/development/src/components/triggers/TenantActionTrigger.js.map +1 -1
- package/dist/development/src/contexts.cjs.map +1 -1
- package/dist/development/src/contexts.js +1 -1
- package/dist/development/src/contexts.js.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useSignInMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useSignInMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useSignOutMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.cjs +6 -3
- package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.js +6 -3
- package/dist/development/src/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/invite/useInviteMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/invite/useInviteMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.js.map +1 -1
- package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.js.map +1 -1
- package/dist/development/src/hooks/mutations/profile/useChangeProfile.cjs.map +1 -1
- package/dist/development/src/hooks/mutations/profile/useChangeProfile.js.map +1 -1
- package/dist/development/src/hooks/queries/useMeQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useMeQuery.js.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembersQuery.cjs +15 -9
- package/dist/development/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembersQuery.js +15 -9
- package/dist/development/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembershipsQuery.js.map +1 -1
- package/dist/development/src/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -1
- package/dist/development/src/hooks/useFetchIdentity.cjs +4 -1
- package/dist/development/src/hooks/useFetchIdentity.cjs.map +1 -1
- package/dist/development/src/hooks/useFetchIdentity.js +4 -1
- package/dist/development/src/hooks/useFetchIdentity.js.map +1 -1
- package/dist/development/src/hooks/useLogout.cjs.map +1 -1
- package/dist/development/src/hooks/useLogout.js.map +1 -1
- package/dist/development/src/hooks/usePasswordlessOtpActivator.cjs.map +1 -1
- package/dist/development/src/hooks/usePasswordlessOtpActivator.js.map +1 -1
- package/dist/development/src/hooks/useTenantApi.cjs +1 -1
- package/dist/development/src/hooks/useTenantApi.cjs.map +1 -1
- package/dist/development/src/hooks/useTenantApi.js +1 -1
- package/dist/development/src/hooks/useTenantApi.js.map +1 -1
- package/dist/development/src/hooks/useTenantMutation.cjs.map +1 -1
- package/dist/development/src/hooks/useTenantMutation.js +1 -1
- package/dist/development/src/hooks/useTenantMutation.js.map +1 -1
- package/dist/development/src/hooks/useTenantQueryLoader.cjs.map +1 -1
- package/dist/development/src/hooks/useTenantQueryLoader.js.map +1 -1
- package/dist/development/src/internal/hooks/useHandleIDPResponse.cjs +3 -3
- package/dist/development/src/internal/hooks/useHandleIDPResponse.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useHandleIDPResponse.js +3 -3
- package/dist/development/src/internal/hooks/useHandleIDPResponse.js.map +1 -1
- package/dist/development/src/internal/hooks/useIDPAutoInit.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useIDPAutoInit.js.map +1 -1
- package/dist/development/src/internal/hooks/useIDPStateStore.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useIDPStateStore.js.map +1 -1
- package/dist/development/src/internal/hooks/useInitIDPRedirect.cjs +3 -3
- package/dist/development/src/internal/hooks/useInitIDPRedirect.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useInitIDPRedirect.js +3 -3
- package/dist/development/src/internal/hooks/useInitIDPRedirect.js.map +1 -1
- package/dist/development/src/internal/hooks/useLogoutInternal.cjs +1 -1
- package/dist/development/src/internal/hooks/useLogoutInternal.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useLogoutInternal.js +1 -1
- package/dist/development/src/internal/hooks/useLogoutInternal.js.map +1 -1
- package/dist/development/src/internal/hooks/useRedirectToBacklink.cjs +9 -4
- package/dist/development/src/internal/hooks/useRedirectToBacklink.cjs.map +1 -1
- package/dist/development/src/internal/hooks/useRedirectToBacklink.js +9 -4
- package/dist/development/src/internal/hooks/useRedirectToBacklink.js.map +1 -1
- package/dist/development/src/internal/utils/getBaseHref.cjs.map +1 -1
- package/dist/development/src/internal/utils/getBaseHref.js.map +1 -1
- package/dist/development/src/internal/utils/hashing.cjs.map +1 -1
- package/dist/development/src/internal/utils/hashing.js.map +1 -1
- package/dist/development/src/internal/utils/randomInt.cjs.map +1 -1
- package/dist/development/src/internal/utils/randomInt.js.map +1 -1
- package/dist/production/index.cjs +80 -80
- package/dist/production/index.js +31 -31
- package/dist/production/src/components/IdentityProvider.cjs.map +1 -1
- package/dist/production/src/components/IdentityProvider.js.map +1 -1
- package/dist/production/src/components/IdentityState.cjs.map +1 -1
- package/dist/production/src/components/IdentityState.js.map +1 -1
- package/dist/production/src/components/forms/ChangeMyPasswordForm.cjs.map +1 -1
- package/dist/production/src/components/forms/ChangeMyPasswordForm.js.map +1 -1
- package/dist/production/src/components/forms/CreateApiKeyForm.cjs.map +1 -1
- package/dist/production/src/components/forms/CreateApiKeyForm.js.map +1 -1
- package/dist/production/src/components/forms/CreateSessionTokenForm.cjs.map +1 -1
- package/dist/production/src/components/forms/CreateSessionTokenForm.js.map +1 -1
- package/dist/production/src/components/forms/InviteForm.cjs.map +1 -1
- package/dist/production/src/components/forms/InviteForm.js.map +1 -1
- package/dist/production/src/components/forms/LoginForm.cjs +2 -0
- package/dist/production/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/production/src/components/forms/LoginForm.js +2 -0
- package/dist/production/src/components/forms/LoginForm.js.map +1 -1
- package/dist/production/src/components/forms/OtpConfirmForm.cjs.map +1 -1
- package/dist/production/src/components/forms/OtpConfirmForm.js.map +1 -1
- package/dist/production/src/components/forms/OtpPrepareForm.cjs.map +1 -1
- package/dist/production/src/components/forms/OtpPrepareForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordResetForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordResetForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordResetRequestForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordResetRequestForm.js +1 -1
- package/dist/production/src/components/forms/PasswordResetRequestForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.cjs +2 -2
- package/dist/production/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.js +3 -3
- package/dist/production/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.cjs +5 -0
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.js +6 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.js.map +1 -1
- package/dist/production/src/components/forms/TenantForm.cjs +13 -7
- package/dist/production/src/components/forms/TenantForm.cjs.map +1 -1
- package/dist/production/src/components/forms/TenantForm.js +13 -7
- package/dist/production/src/components/forms/TenantForm.js.map +1 -1
- package/dist/production/src/components/forms/UpdateProjectMemberForm.cjs.map +1 -1
- package/dist/production/src/components/forms/UpdateProjectMemberForm.js.map +1 -1
- package/dist/production/src/components/idp/IDP.cjs +3 -3
- package/dist/production/src/components/idp/IDP.cjs.map +1 -1
- package/dist/production/src/components/idp/IDP.js +3 -3
- package/dist/production/src/components/idp/IDP.js.map +1 -1
- package/dist/production/src/components/idp/IDPInitTrigger.cjs.map +1 -1
- package/dist/production/src/components/idp/IDPInitTrigger.js.map +1 -1
- package/dist/production/src/components/idp/IDPState.cjs.map +1 -1
- package/dist/production/src/components/idp/IDPState.js.map +1 -1
- package/dist/production/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/DisableOtpTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/LogoutTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/LogoutTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/TenantActionTrigger.js.map +1 -1
- package/dist/production/src/contexts.cjs.map +1 -1
- package/dist/production/src/contexts.js +1 -1
- package/dist/production/src/contexts.js.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useSignInMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useSignInMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useSignOutMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.cjs +6 -3
- package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.js +6 -3
- package/dist/production/src/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/invite/useInviteMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/invite/useInviteMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/passwordless/useSignInPasswordlessMutation.js.map +1 -1
- package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.js.map +1 -1
- package/dist/production/src/hooks/mutations/profile/useChangeProfile.cjs.map +1 -1
- package/dist/production/src/hooks/mutations/profile/useChangeProfile.js.map +1 -1
- package/dist/production/src/hooks/queries/useMeQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useMeQuery.js.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembersQuery.cjs +15 -9
- package/dist/production/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembersQuery.js +15 -9
- package/dist/production/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembershipsQuery.js.map +1 -1
- package/dist/production/src/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -1
- package/dist/production/src/hooks/useFetchIdentity.cjs +4 -1
- package/dist/production/src/hooks/useFetchIdentity.cjs.map +1 -1
- package/dist/production/src/hooks/useFetchIdentity.js +4 -1
- package/dist/production/src/hooks/useFetchIdentity.js.map +1 -1
- package/dist/production/src/hooks/useLogout.cjs.map +1 -1
- package/dist/production/src/hooks/useLogout.js.map +1 -1
- package/dist/production/src/hooks/usePasswordlessOtpActivator.cjs.map +1 -1
- package/dist/production/src/hooks/usePasswordlessOtpActivator.js.map +1 -1
- package/dist/production/src/hooks/useTenantApi.cjs +1 -1
- package/dist/production/src/hooks/useTenantApi.cjs.map +1 -1
- package/dist/production/src/hooks/useTenantApi.js +1 -1
- package/dist/production/src/hooks/useTenantApi.js.map +1 -1
- package/dist/production/src/hooks/useTenantMutation.cjs.map +1 -1
- package/dist/production/src/hooks/useTenantMutation.js +1 -1
- package/dist/production/src/hooks/useTenantMutation.js.map +1 -1
- package/dist/production/src/hooks/useTenantQueryLoader.cjs.map +1 -1
- package/dist/production/src/hooks/useTenantQueryLoader.js.map +1 -1
- package/dist/production/src/internal/hooks/useHandleIDPResponse.cjs +3 -3
- package/dist/production/src/internal/hooks/useHandleIDPResponse.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useHandleIDPResponse.js +3 -3
- package/dist/production/src/internal/hooks/useHandleIDPResponse.js.map +1 -1
- package/dist/production/src/internal/hooks/useIDPAutoInit.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useIDPAutoInit.js.map +1 -1
- package/dist/production/src/internal/hooks/useIDPStateStore.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useIDPStateStore.js.map +1 -1
- package/dist/production/src/internal/hooks/useInitIDPRedirect.cjs +3 -3
- package/dist/production/src/internal/hooks/useInitIDPRedirect.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useInitIDPRedirect.js +3 -3
- package/dist/production/src/internal/hooks/useInitIDPRedirect.js.map +1 -1
- package/dist/production/src/internal/hooks/useLogoutInternal.cjs +1 -1
- package/dist/production/src/internal/hooks/useLogoutInternal.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useLogoutInternal.js +1 -1
- package/dist/production/src/internal/hooks/useLogoutInternal.js.map +1 -1
- package/dist/production/src/internal/hooks/useRedirectToBacklink.cjs +9 -4
- package/dist/production/src/internal/hooks/useRedirectToBacklink.cjs.map +1 -1
- package/dist/production/src/internal/hooks/useRedirectToBacklink.js +9 -4
- package/dist/production/src/internal/hooks/useRedirectToBacklink.js.map +1 -1
- package/dist/production/src/internal/utils/getBaseHref.cjs.map +1 -1
- package/dist/production/src/internal/utils/getBaseHref.js.map +1 -1
- package/dist/production/src/internal/utils/hashing.cjs.map +1 -1
- package/dist/production/src/internal/utils/hashing.js.map +1 -1
- package/dist/production/src/internal/utils/randomInt.cjs.map +1 -1
- package/dist/production/src/internal/utils/randomInt.js.map +1 -1
- package/dist/types/components/IdentityProvider.d.ts.map +1 -1
- package/dist/types/components/forms/ChangeMyPasswordForm.d.ts.map +1 -1
- package/dist/types/components/forms/LoginForm.d.ts.map +1 -1
- package/dist/types/components/forms/OtpPrepareForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordResetForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordResetRequestForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordlessSignInForm.d.ts +1 -1
- package/dist/types/components/forms/PasswordlessSignInForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordlessSignInInitForm.d.ts.map +1 -1
- package/dist/types/components/forms/TenantForm.d.ts.map +1 -1
- package/dist/types/components/forms/UpdateProjectMemberForm.d.ts +1 -1
- package/dist/types/components/forms/UpdateProjectMemberForm.d.ts.map +1 -1
- package/dist/types/components/idp/IDP.d.ts +3 -1
- package/dist/types/components/idp/IDP.d.ts.map +1 -1
- package/dist/types/components/idp/IDPInitTrigger.d.ts.map +1 -1
- package/dist/types/components/triggers/DisableOtpTrigger.d.ts.map +1 -1
- package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts.map +1 -1
- package/dist/types/components/triggers/TenantActionTrigger.d.ts.map +1 -1
- package/dist/types/contexts.d.ts.map +1 -1
- package/dist/types/hooks/mutations/apiKey/useCreateApiKeyMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts +3 -1
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts +4 -2
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts +2 -2
- package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts +4 -2
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.d.ts +2 -2
- package/dist/types/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.d.ts +1 -1
- package/dist/types/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/passwordless/useInitSignInPasswordlessMutation.d.ts +2 -2
- package/dist/types/hooks/mutations/passwordless/useSignInPasswordlessMutation.d.ts +2 -2
- package/dist/types/hooks/mutations/profile/useChangeMyProfile.d.ts +1 -1
- package/dist/types/hooks/mutations/profile/useChangeMyProfile.d.ts.map +1 -1
- package/dist/types/hooks/mutations/profile/useChangeProfile.d.ts +1 -1
- package/dist/types/hooks/mutations/profile/useChangeProfile.d.ts.map +1 -1
- package/dist/types/hooks/queries/useMeQuery.d.ts.map +1 -1
- package/dist/types/hooks/queries/useProjectMembersQuery.d.ts.map +1 -1
- package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts.map +1 -1
- package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts.map +1 -1
- package/dist/types/hooks/useFetchIdentity.d.ts.map +1 -1
- package/dist/types/hooks/usePasswordlessOtpActivator.d.ts.map +1 -1
- package/dist/types/hooks/useTenantApi.d.ts.map +1 -1
- package/dist/types/hooks/useTenantMutation.d.ts.map +1 -1
- package/dist/types/hooks/useTenantQueryLoader.d.ts.map +1 -1
- package/dist/types/internal/hooks/useHandleIDPResponse.d.ts +2 -1
- package/dist/types/internal/hooks/useHandleIDPResponse.d.ts.map +1 -1
- package/dist/types/internal/hooks/useIDPStateStore.d.ts.map +1 -1
- package/dist/types/internal/hooks/useInitIDPRedirect.d.ts +2 -1
- package/dist/types/internal/hooks/useInitIDPRedirect.d.ts.map +1 -1
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts +3 -1
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts.map +1 -1
- package/dist/types/internal/utils/randomInt.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/idp.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/components/IdentityProvider.tsx +0 -2
- package/src/components/forms/ChangeMyPasswordForm.tsx +0 -1
- package/src/components/forms/LoginForm.tsx +2 -2
- package/src/components/forms/OtpConfirmForm.tsx +1 -2
- package/src/components/forms/OtpPrepareForm.tsx +1 -3
- package/src/components/forms/PasswordResetForm.tsx +0 -1
- package/src/components/forms/PasswordResetRequestForm.tsx +0 -3
- package/src/components/forms/PasswordlessSignInForm.tsx +12 -9
- package/src/components/forms/PasswordlessSignInInitForm.tsx +6 -3
- package/src/components/forms/TenantForm.tsx +14 -10
- package/src/components/forms/UpdateProjectMemberForm.tsx +2 -2
- package/src/components/idp/IDP.tsx +5 -5
- package/src/components/idp/IDPInitTrigger.tsx +1 -3
- package/src/components/triggers/DisableOtpTrigger.tsx +2 -1
- package/src/components/triggers/RemoveProjectMemberTrigger.tsx +0 -1
- package/src/components/triggers/TenantActionTrigger.tsx +4 -2
- package/src/contexts.ts +0 -2
- package/src/hooks/mutations/apiKey/useDisableApiKeyMutation.tsx +0 -1
- package/src/hooks/mutations/auth/useSignInMutation.ts +0 -1
- package/src/hooks/mutations/idp/useInitSignInIDPMutation.ts +5 -2
- package/src/hooks/mutations/idp/useSignInIdpMutation.ts +6 -4
- package/src/hooks/mutations/otp/useConfirmOtpMutation.ts +5 -5
- package/src/hooks/mutations/otp/usePrepareOtpMutation.ts +0 -1
- package/src/hooks/mutations/passwordless/useActivatePasswordlessOtpMutation.ts +0 -1
- package/src/hooks/mutations/passwordless/useDisableMyPasswordlessMutation.ts +0 -1
- package/src/hooks/mutations/passwordless/useEnableMyPasswordlessMutation.ts +0 -1
- package/src/hooks/mutations/profile/useChangeMyProfile.ts +2 -2
- package/src/hooks/mutations/profile/useChangeProfile.ts +2 -2
- package/src/hooks/queries/useMeQuery.ts +5 -4
- package/src/hooks/queries/useProjectMembersQuery.ts +19 -14
- package/src/hooks/queries/useProjectMembershipsQuery.ts +0 -1
- package/src/hooks/queries/useProjectRolesDefinitionQuery.ts +1 -2
- package/src/hooks/useFetchIdentity.ts +4 -1
- package/src/hooks/usePasswordlessOtpActivator.ts +4 -3
- package/src/hooks/useTenantApi.ts +0 -1
- package/src/hooks/useTenantMutation.ts +8 -6
- package/src/hooks/useTenantQueryLoader.ts +4 -3
- package/src/internal/hooks/useHandleIDPResponse.ts +6 -3
- package/src/internal/hooks/useIDPAutoInit.ts +0 -1
- package/src/internal/hooks/useIDPStateStore.ts +1 -1
- package/src/internal/hooks/useInitIDPRedirect.ts +4 -3
- package/src/internal/hooks/useLogoutInternal.ts +1 -1
- package/src/internal/hooks/useRedirectToBacklink.ts +11 -5
- package/src/internal/utils/randomInt.ts +0 -1
- package/src/types/idp.ts +0 -1
|
@@ -8,8 +8,7 @@ const projectRolesDefinitionFragment = TenantApi.roleDefinition$$
|
|
|
8
8
|
TenantApi.roleVariableDefinition$$
|
|
9
9
|
.on(TenantApi.roleConditionVariableDefinition$$)
|
|
10
10
|
.on(TenantApi.roleEntityVariableDefinition$$)
|
|
11
|
-
.on(TenantApi.rolePredefinedVariableDefinition$$)
|
|
12
|
-
,
|
|
11
|
+
.on(TenantApi.rolePredefinedVariableDefinition$$),
|
|
13
12
|
)
|
|
14
13
|
|
|
15
14
|
export type ProjectRoleDefinition = ModelType<typeof projectRolesDefinitionFragment>
|
|
@@ -8,7 +8,10 @@ export const useFetchIdentity = (): [{ state: IdentityStateValue; identity: Iden
|
|
|
8
8
|
const sessionToken = useSessionToken()
|
|
9
9
|
const fetchMe = useMeQuery()
|
|
10
10
|
|
|
11
|
-
const [identityState, setIdentityState] = useState<ReturnType<typeof useFetchIdentity>[0]>({
|
|
11
|
+
const [identityState, setIdentityState] = useState<ReturnType<typeof useFetchIdentity>[0]>({
|
|
12
|
+
state: sessionToken ? 'loading' : 'none',
|
|
13
|
+
identity: undefined,
|
|
14
|
+
})
|
|
12
15
|
|
|
13
16
|
const clearIdentity = useCallback(() => setIdentityState({ state: 'cleared', identity: undefined }), [])
|
|
14
17
|
const logout = useLogoutInternal(clearIdentity)
|
|
@@ -5,7 +5,7 @@ import { randomString } from '../internal/utils/randomInt'
|
|
|
5
5
|
import { calculateHash } from '../internal/utils/hashing'
|
|
6
6
|
import { ActivatePasswordlessOtpErrorCode } from '@contember/graphql-client-tenant'
|
|
7
7
|
|
|
8
|
-
const usePasswordlessParams = (): {localStorageRequestId: string | null; urlRequestId: string | null; urlToken: string | null} => {
|
|
8
|
+
const usePasswordlessParams = (): { localStorageRequestId: string | null; urlRequestId: string | null; urlToken: string | null } => {
|
|
9
9
|
const localStorageValue = localStorage.getItem(PASSWORDLESS_REQUEST_STORAGE_KEY) ?? null
|
|
10
10
|
const urlParams = new URLSearchParams(window.location.search)
|
|
11
11
|
const requestId = urlParams.get('request_id')
|
|
@@ -18,7 +18,7 @@ export type PasswordlessResponseHandlerState =
|
|
|
18
18
|
| { type: 'empty' }
|
|
19
19
|
| { type: 'otp_activating' }
|
|
20
20
|
| { type: 'otp_activated'; otp: string }
|
|
21
|
-
| { type: 'otp_activation_failed'; error: ActivatePasswordlessOtpErrorCode | 'UNKNOWN_ERROR'}
|
|
21
|
+
| { type: 'otp_activation_failed'; error: ActivatePasswordlessOtpErrorCode | 'UNKNOWN_ERROR' }
|
|
22
22
|
| { type: 'can_proceed_to_login' }
|
|
23
23
|
|
|
24
24
|
export const usePasswordlessOtpActivator = ({ otpLength = 6, otpChars = '0123456789ABCDEF' }: {
|
|
@@ -39,8 +39,9 @@ export const usePasswordlessOtpActivator = ({ otpLength = 6, otpChars = '0123456
|
|
|
39
39
|
return { type: 'empty' }
|
|
40
40
|
})
|
|
41
41
|
|
|
42
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: intentional
|
|
42
43
|
useEffect(() => {
|
|
43
|
-
(async () => {
|
|
44
|
+
;(async () => {
|
|
44
45
|
if (state.type === 'otp_activating') {
|
|
45
46
|
const otpCode = randomString(otpLength, otpChars)
|
|
46
47
|
try {
|
|
@@ -21,7 +21,6 @@ export const useTenantApi = ({ headers, apiToken }: TenantApiOptions = {}) => {
|
|
|
21
21
|
readonly apiToken?: string | typeof LoginToken
|
|
22
22
|
},
|
|
23
23
|
): Promise<TData> => {
|
|
24
|
-
|
|
25
24
|
const writer = new TextWriter()
|
|
26
25
|
writer.text(`${fetcher.fetchableType.name.toLowerCase()}`)
|
|
27
26
|
if (fetcher.variableTypeMap.size !== 0) {
|
|
@@ -6,7 +6,9 @@ export type TenantMutationOkResponse<Result> = { ok: true; result: Result }
|
|
|
6
6
|
export type TenantMutationErrorResponse<Error> = { ok: false; error: Error; developerMessage?: string }
|
|
7
7
|
export type TenantMutationResponse<Result, Error> = TenantMutationOkResponse<Result> | TenantMutationErrorResponse<Error>
|
|
8
8
|
|
|
9
|
-
export type TenantMutation<Result, Error> = {
|
|
9
|
+
export type TenantMutation<Result, Error> = {
|
|
10
|
+
readonly mutation?: { readonly ok: boolean; readonly error?: { readonly code: Error; readonly developerMessage: string }; readonly result?: Result }
|
|
11
|
+
}
|
|
10
12
|
|
|
11
13
|
export const useTenantMutation = <TResult, TError extends string = never, TVariables extends object = {}>(
|
|
12
14
|
fetcher: MutationFetcher<TenantMutation<TResult, TError>, TVariables>,
|
|
@@ -33,13 +35,13 @@ export const useTenantMutation = <TResult, TError extends string = never, TVaria
|
|
|
33
35
|
}, [fetcher, tenantApi])
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
37
38
|
export const createTenantMutation = <TResult, TError extends string = never, TVariables extends object = {}>(
|
|
38
39
|
fetcher: MutationFetcher<TenantMutation<TResult, TError>, TVariables>,
|
|
39
40
|
defaultOptions?: TenantApiOptions,
|
|
40
41
|
) => {
|
|
41
|
-
return ({ headers, apiToken }: TenantApiOptions = {}) =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
return ({ headers, apiToken }: TenantApiOptions = {}) =>
|
|
43
|
+
useTenantMutation(fetcher, {
|
|
44
|
+
headers: useMemo(() => ({ ...defaultOptions?.headers, ...headers }), [headers]),
|
|
45
|
+
apiToken: apiToken ?? defaultOptions?.apiToken,
|
|
46
|
+
})
|
|
45
47
|
}
|
|
@@ -11,7 +11,10 @@ export type TenantQueryLoaderMethods = {
|
|
|
11
11
|
refresh: () => void
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const useTenantQueryLoader = <TVariables extends object, Result>(
|
|
14
|
+
export const useTenantQueryLoader = <TVariables extends object, Result>(
|
|
15
|
+
fetcher: (variables: TVariables) => Promise<Result>,
|
|
16
|
+
variables: TVariables,
|
|
17
|
+
): [TenantQueryLoaderState<Result>, TenantQueryLoaderMethods] => {
|
|
15
18
|
const [state, setState] = useState<TenantQueryLoaderState<Result>>({ state: 'loading' })
|
|
16
19
|
const stateRef = useRef(state)
|
|
17
20
|
stateRef.current = state
|
|
@@ -37,10 +40,8 @@ export const useTenantQueryLoader = <TVariables extends object, Result>(fetcher:
|
|
|
37
40
|
}
|
|
38
41
|
setState({ state: 'error', error: e })
|
|
39
42
|
}
|
|
40
|
-
|
|
41
43
|
}, [fetcher, variablesMemo])
|
|
42
44
|
|
|
43
|
-
|
|
44
45
|
useEffect(() => {
|
|
45
46
|
triggerLoad()
|
|
46
47
|
}, [triggerLoad])
|
|
@@ -12,6 +12,7 @@ export interface UseHandleIDPResponseProps {
|
|
|
12
12
|
|
|
13
13
|
setState: (state: SetStateAction<IDPStateValue>) => void
|
|
14
14
|
hasOauthResponse: boolean
|
|
15
|
+
redirectUrl?: string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const headers = {
|
|
@@ -20,7 +21,9 @@ const headers = {
|
|
|
20
21
|
|
|
21
22
|
const DEFAULT_LOGIN_EXPIRATION = 14 * 24 * 60 // 14 days
|
|
22
23
|
|
|
23
|
-
export const useHandleIDPResponse = (
|
|
24
|
+
export const useHandleIDPResponse = (
|
|
25
|
+
{ onLogin, expiration = DEFAULT_LOGIN_EXPIRATION, setState, hasOauthResponse, redirectUrl }: UseHandleIDPResponseProps,
|
|
26
|
+
): void => {
|
|
24
27
|
const idpSignIn = useSignInIDPMutation({ headers })
|
|
25
28
|
const setSessionToken = useSetSessionToken()
|
|
26
29
|
|
|
@@ -44,7 +47,7 @@ export const useHandleIDPResponse = ({ onLogin, expiration = DEFAULT_LOGIN_EXPIR
|
|
|
44
47
|
const response = await idpSignIn({
|
|
45
48
|
data: {
|
|
46
49
|
url: window.location.href,
|
|
47
|
-
redirectUrl: getBaseHref(),
|
|
50
|
+
redirectUrl: redirectUrl || getBaseHref(),
|
|
48
51
|
sessionData: idpState.sessionData,
|
|
49
52
|
},
|
|
50
53
|
identityProvider: idpState.provider,
|
|
@@ -60,5 +63,5 @@ export const useHandleIDPResponse = ({ onLogin, expiration = DEFAULT_LOGIN_EXPIR
|
|
|
60
63
|
redirectToBackLink()
|
|
61
64
|
}
|
|
62
65
|
})()
|
|
63
|
-
}, [idpSignIn, onLogin, setSessionToken, hasOauthResponse, loadIdpState, expiration, setState, redirectToBackLink])
|
|
66
|
+
}, [idpSignIn, onLogin, setSessionToken, hasOauthResponse, loadIdpState, expiration, setState, redirectToBackLink, redirectUrl])
|
|
64
67
|
}
|
|
@@ -2,7 +2,7 @@ import { useCallback } from 'react'
|
|
|
2
2
|
|
|
3
3
|
export type IDPState = { provider: string; sessionData: any }
|
|
4
4
|
|
|
5
|
-
export const useIDPStateStore = (): {get: () => IDPState | null; set: (state: IDPState) => void} => {
|
|
5
|
+
export const useIDPStateStore = (): { get: () => IDPState | null; set: (state: IDPState) => void } => {
|
|
6
6
|
return {
|
|
7
7
|
get: useCallback(() => {
|
|
8
8
|
const item = sessionStorage.getItem('idp')
|
|
@@ -8,9 +8,10 @@ import { useSaveBacklink } from './useRedirectToBacklink'
|
|
|
8
8
|
export interface UseInitIDPRedirectProps {
|
|
9
9
|
onRedirect?: (url: string) => void
|
|
10
10
|
setState: (state: SetStateAction<IDPStateValue>) => void
|
|
11
|
+
redirectUrl?: string
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export const useInitIDPRedirect = ({ onRedirect, setState }: UseInitIDPRedirectProps) => {
|
|
14
|
+
export const useInitIDPRedirect = ({ onRedirect, setState, redirectUrl }: UseInitIDPRedirectProps) => {
|
|
14
15
|
const initRequest = useInitSignInIDPMutation()
|
|
15
16
|
const saveBacklink = useSaveBacklink()
|
|
16
17
|
const { set: saveIdpState } = useIDPStateStore()
|
|
@@ -24,7 +25,7 @@ export const useInitIDPRedirect = ({ onRedirect, setState }: UseInitIDPRedirectP
|
|
|
24
25
|
setState({ type: 'processing_init' })
|
|
25
26
|
const response = await initRequest({
|
|
26
27
|
data: {
|
|
27
|
-
redirectUrl: getBaseHref(),
|
|
28
|
+
redirectUrl: redirectUrl || getBaseHref(),
|
|
28
29
|
},
|
|
29
30
|
identityProvider: provider,
|
|
30
31
|
})
|
|
@@ -44,5 +45,5 @@ export const useInitIDPRedirect = ({ onRedirect, setState }: UseInitIDPRedirectP
|
|
|
44
45
|
console.error(e)
|
|
45
46
|
return fail('UNKNOWN_ERROR')
|
|
46
47
|
}
|
|
47
|
-
}, [initRequest, onRedirect, saveBacklink, saveIdpState, setState])
|
|
48
|
+
}, [initRequest, onRedirect, saveBacklink, saveIdpState, setState, redirectUrl])
|
|
48
49
|
}
|
|
@@ -8,7 +8,7 @@ export const useLogoutInternal = (clearIdentity?: () => void) => {
|
|
|
8
8
|
|
|
9
9
|
return useCallback(
|
|
10
10
|
async ({ noRedirect = false }: { noRedirect?: boolean } = {}) => {
|
|
11
|
-
if (navigator.credentials
|
|
11
|
+
if (navigator.credentials?.preventSilentAccess) {
|
|
12
12
|
try {
|
|
13
13
|
await navigator.credentials.preventSilentAccess()
|
|
14
14
|
} catch {
|
|
@@ -5,23 +5,30 @@ const getBacklinkFromUrl = () => {
|
|
|
5
5
|
return new URLSearchParams(window.location.search).get('backlink')
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export const useSaveBacklink = (
|
|
8
|
+
export const useSaveBacklink = ({ storage = 'session' }: {
|
|
9
|
+
storage?: 'session' | 'local'
|
|
10
|
+
} = {}) => {
|
|
9
11
|
return useCallback(() => {
|
|
10
12
|
const backlink = getBacklinkFromUrl()
|
|
11
13
|
if (!backlink) {
|
|
12
14
|
return
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
if (storage === 'local') {
|
|
17
|
+
localStorage.setItem('backlink', backlink)
|
|
18
|
+
} else {
|
|
19
|
+
sessionStorage.setItem('backlink', backlink)
|
|
20
|
+
}
|
|
21
|
+
}, [storage])
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export const useRedirectToBacklinkCallback = () => {
|
|
19
25
|
return useCallback(() => {
|
|
20
|
-
const backlink = getBacklinkFromUrl() ?? sessionStorage.getItem('backlink')
|
|
26
|
+
const backlink = getBacklinkFromUrl() ?? sessionStorage.getItem('backlink') ?? localStorage.getItem('backlink')
|
|
21
27
|
if (!backlink) {
|
|
22
28
|
return
|
|
23
29
|
}
|
|
24
30
|
sessionStorage.removeItem('backlink')
|
|
31
|
+
localStorage.removeItem('backlink')
|
|
25
32
|
const resolvedBacklink = new URL(backlink, window.location.href)
|
|
26
33
|
if (resolvedBacklink.origin === window.location.origin) {
|
|
27
34
|
window.location.href = resolvedBacklink.toString()
|
|
@@ -38,5 +45,4 @@ export const useRedirectToBacklink = () => {
|
|
|
38
45
|
}
|
|
39
46
|
redirect()
|
|
40
47
|
}, [identity, redirect])
|
|
41
|
-
|
|
42
48
|
}
|