From 6bbd380392fff734f06433d011b269451964c231 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Sat, 7 Jan 2023 13:04:07 -0800 Subject: [PATCH] Rm use-session --- src/app/lib/use-session.ts | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/app/lib/use-session.ts diff --git a/src/app/lib/use-session.ts b/src/app/lib/use-session.ts deleted file mode 100644 index 03472c16..00000000 --- a/src/app/lib/use-session.ts +++ /dev/null @@ -1,17 +0,0 @@ -// A wrapper around next-auth/use-session that refreshes the page if the session changes - -import { useEffect } from "react" -import { useSession as useSessionOriginal } from "next-auth/react" -import { useRouter } from "next/navigation" - - -export function useSession() { - const { data: session, status } = useSessionOriginal() - const router = useRouter(); - - useEffect(() => { - router.refresh(); - }, [router, status]) - - return { session, status } -}