I use next auth version 4 with next for client side authentication, I want a modal to display when the session is expired. The value open (In the code ) always remains false even though the session was expired. Here's my code :
const [open,setOpen] = useState(false);
const fetchMySession = useCallback( async () =>{
const session = await getSession({});
setOpen(!session?.user)
console.log("Session Dialog",session,!session)
}, [])
useEffect(() => {
console.log("Call fetch my API ")
fetchMySession()
}, [fetchMySession])