this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: use router when sign out

+15 -1
+15 -1
src/components/settings.tsx
··· 8 8 import { HugeiconsIcon } from "@hugeicons/react"; 9 9 import type { User } from "better-auth"; 10 10 import Link from "next/link"; 11 + import { useRouter } from "next/navigation"; 11 12 import { Button } from "@/components/ui/button"; 12 13 import { ButtonGroup } from "@/components/ui/button-group"; 13 14 import { ··· 61 62 await updateSetting(notify); 62 63 }; 63 64 65 + const router = useRouter(); 66 + 64 67 return ( 65 68 <Card> 66 69 <CardHeader> ··· 78 81 <HugeiconsIcon icon={ArrowLeft01Icon} /> 79 82 Back 80 83 </Button> 81 - <Button variant="destructive" onClick={() => authClient.signOut()}> 84 + <Button 85 + variant="destructive" 86 + onClick={() => 87 + authClient.signOut({ 88 + fetchOptions: { 89 + onSuccess: () => { 90 + router.push("/"); 91 + }, 92 + }, 93 + }) 94 + } 95 + > 82 96 <HugeiconsIcon icon={Logout01Icon} /> 83 97 Logout 84 98 </Button>