Rm use-session
This commit is contained in:
parent
d9e7aa5ecf
commit
6bbd380392
1 changed files with 0 additions and 17 deletions
|
@ -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 }
|
||||
}
|
Loading…
Reference in a new issue