Fixed: Issue #830 - Adding a secondary account now correctly redirects to the current path instead of the landing page

This commit is contained in:
Abhishek Kumar
2025-05-04 23:27:14 +05:30
parent d73ebfa88a
commit e618e48e16

View File

@@ -13,6 +13,7 @@ import { useTranslations } from 'next-intl';
import { Button } from '../ui/button';
import { motion } from 'motion/react';
import { cn } from '@/lib/utils';
import { usePathname } from 'next/navigation'
export const AddConnectionDialog = ({
children,
@@ -25,6 +26,8 @@ export const AddConnectionDialog = ({
}) => {
const t = useTranslations();
const pathname = usePathname();
return (
<Dialog onOpenChange={onOpenChange}>
<DialogTrigger asChild>
@@ -70,6 +73,7 @@ export const AddConnectionDialog = ({
onClick={async () =>
await authClient.linkSocial({
provider: provider.providerId,
callbackURL: pathname
})
}
>