I am using nextAuth for authentication in my project and I would like to restrict certain pages for the clients that are not logged in.
I tried calling the useSession() hook in the getServerSideProps() function but I got an error for calling the hook there.
Is it possible to do a redirect on the server side using nextAuth?