From e618e48e16a9811fbe97ea00a56c4353b4f07fc7 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 4 May 2025 23:27:14 +0530 Subject: [PATCH] Fixed: Issue #830 - Adding a secondary account now correctly redirects to the current path instead of the landing page --- apps/mail/components/connection/add.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/mail/components/connection/add.tsx b/apps/mail/components/connection/add.tsx index 903264762..e9395f681 100644 --- a/apps/mail/components/connection/add.tsx +++ b/apps/mail/components/connection/add.tsx @@ -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 ( @@ -70,6 +73,7 @@ export const AddConnectionDialog = ({ onClick={async () => await authClient.linkSocial({ provider: provider.providerId, + callbackURL: pathname }) } >