0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(ui): should handle requiredProfile error on bindSocialRelatedUser (#3034)

This commit is contained in:
simeng-li 2023-02-03 17:26:35 +08:00 committed by GitHub
parent f298e1c296
commit 61a89f829e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,8 +3,14 @@ import { useEffect } from 'react';
import { bindSocialRelatedUser } from '@/apis/interaction';
import useApi from '@/hooks/use-api';
import useRequiredProfileErrorHandler from './use-required-profile-error-handler';
const useBindSocialRelatedUser = () => {
const { result: bindUserResult, run: asyncBindSocialRelatedUser } = useApi(bindSocialRelatedUser);
const requiredProfileErrorHandlers = useRequiredProfileErrorHandler();
const { result: bindUserResult, run: asyncBindSocialRelatedUser } = useApi(
bindSocialRelatedUser,
requiredProfileErrorHandlers
);
useEffect(() => {
if (bindUserResult?.redirectTo) {