From 7a739bd10aacaeec6956d80f882a532a4cf07dca Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Thu, 19 Sep 2024 20:25:25 -0400 Subject: [PATCH] Don't logout the current session when setting up TFA --- src/components/dashboard/user/settings/tfa/tfa-setting.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/dashboard/user/settings/tfa/tfa-setting.tsx b/src/components/dashboard/user/settings/tfa/tfa-setting.tsx index 2a8656c..ffd6f93 100644 --- a/src/components/dashboard/user/settings/tfa/tfa-setting.tsx +++ b/src/components/dashboard/user/settings/tfa/tfa-setting.tsx @@ -23,6 +23,7 @@ import { Button } from "@/components/ui/button"; import TfaSetupForm from "@/components/dashboard/user/settings/tfa/tfa-setup-form"; import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; import { useRouter } from "next/navigation"; +import { toast } from "sonner"; /** * The setting that allows a @@ -79,7 +80,10 @@ const TFASetting = (): ReactElement => { if (open) { setupTfa(); } else if (enabledTfa) { - router.push("/auth"); + toast( + "Successfully enabled two-factor auth on your account!" + ); + router.push("/dashboard"); } }} >