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

fix(console): cloud ac profile should use correct callback URL when linking social (#3303)

This commit is contained in:
Charles Zhao 2023-03-06 19:33:04 +08:00 committed by GitHub
parent 3d57b94e30
commit 8caa752106
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -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({

View file

@ -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 } });