obtaining the accountId which the user linked

Hello,

I'd like to add some functionality into my app which when a user links a new social account they will get redirected to /dashboard/feed/{newAccountId}. However, it doesn't seem possible that the account ID is able to be retrieved, I tried using the onSuccess callback, but the response data includes no information about the social that they just linked. Is there a work around for this?

                onClick={async () => {
                  const response = await authClient.linkSocial({
                    provider: 'tiktok',
                    callbackURL: `/dashboard/feed/{accountId}`,
                    disableRedirect: true,
                    fetchOptions: {
                      onSuccess: (r) => {
                        console.log(r.data);
                        console.log(r.request);
                        console.log(r.response);
                      },
                    },
                  });
                  console.log(response);

                  window.open(response.data?.url, 'popup', 'width=500,height=600');
                }}
Was this page helpful?