diff --git a/src/components/sign-in.tsx b/src/components/sign-in.tsx index 5bddf77..7458297 100644 --- a/src/components/sign-in.tsx +++ b/src/components/sign-in.tsx @@ -3,15 +3,19 @@ import { signOut, useSession } from "@/lib/auth-client" import { Button } from "@/components/ui/button" import { useRouter } from "next/navigation" +import { toast } from "sonner" export default function SignIn() { const { data: session, isPending } = useSession() const router = useRouter() const handleSignOut = async () => { - await signOut() - router.push("/") - router.refresh() + try { + await signOut() + router.push("/") + } catch (error) { + toast.error("Failed to sign out. Please try again.") + } } if (isPending) {