Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(console): fix the link social feature on logto cloud #5838

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Props = {

function LinkAccountSection({ user, connectors, onUpdate }: Props) {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const { navigate, getUrl } = useTenantPathname();
const { navigate } = useTenantPathname();
const theme = useTheme();
const { show: showConfirm } = useConfirmModal();
const api = useStaticApi({ prefixUrl: adminTenantEndpoint, resourceIndicator: meApi.indicator });
Expand Down Expand Up @@ -96,7 +96,10 @@ function LinkAccountSection({ user, connectors, onUpdate }: Props) {
name: 'profile.link',
handler: async () => {
const authUri = await getSocialAuthorizationUri(id);
const callback = getUrl('handle-social').href;
// Profile page has been moved to the root path instead of being nested inside a tenant context.
// Therefore, we don't need to use `getUrl` to prepend the tenant segment in the callback URL.
// Also, link social is Cloud only, so no need to conditionally prepend the `ossConsolePath`, either.
const callback = new URL('/handle-social', window.location.href).href;

const queries = new URLSearchParams({
redirectTo: authUri,
Expand Down Expand Up @@ -125,7 +128,6 @@ function LinkAccountSection({ user, connectors, onUpdate }: Props) {
t,
onUpdate,
getSocialAuthorizationUri,
getUrl,
]);

return (
Expand Down
Loading