title: How to redirect in NextJS if not logged using nextAuth
body: <p>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.</p>
  <p>I tried calling the <code>useSession()</code> hook in the <code>getServerSideProps()</code> function but I got an error for calling the hook there.</p>
  <p>Is it possible to do a redirect on the server side using nextAuth?</p>