diff --git a/packages/console/src/pages/Profile/components/LinkAccountSection/index.tsx b/packages/console/src/pages/Profile/components/LinkAccountSection/index.tsx index bd475121e..d7a7e1f08 100644 --- a/packages/console/src/pages/Profile/components/LinkAccountSection/index.tsx +++ b/packages/console/src/pages/Profile/components/LinkAccountSection/index.tsx @@ -111,7 +111,7 @@ const LinkAccountSection = ({ user, onUpdate }: Props) => { const authUri = await getSocialAuthorizationUri(id); const callback = new URL( `${getBasename()}/handle-social`, - adminTenantEndpointUrl + window.location.origin ).toString(); const queries = new URLSearchParams({ diff --git a/packages/console/src/pages/Profile/containers/HandleSocialCallback/index.tsx b/packages/console/src/pages/Profile/containers/HandleSocialCallback/index.tsx index 125b42c0c..18db66824 100644 --- a/packages/console/src/pages/Profile/containers/HandleSocialCallback/index.tsx +++ b/packages/console/src/pages/Profile/containers/HandleSocialCallback/index.tsx @@ -16,7 +16,10 @@ const HandleSocialCallback = () => { if (connectorId) { const queries = new URLSearchParams(search); - queries.set('redirectUri', `${adminTenantEndpoint}/callback/${connectorId}`); + queries.set( + 'redirectUri', + new URL(`/callback/${connectorId}`, new URL(adminTenantEndpoint)).toString() + ); const connectorData = Object.fromEntries(queries); await api.post('me/social/link-identity', { json: { connectorId, connectorData } });