title: Next.js server side props not loading in time
body: <p>I'm using supabase and trying to load the user session on the server side. If you refresh the page, it catches there is a user but not on first load (e.g. like when coming from a magic link). How can I ensure it does load before he page?</p>
  <p>List item</p>
  <p>Here is the page:</p>
  <pre><code>import router from &quot;next/router&quot;;
  import { supabase } from &quot;../utils/supabaseClient&quot;;
  
  function Home() {
    const user = supabase.auth.user()
    if (user){
      //router.push('/admin') failsafe, not ideal
    }
    return (
      &lt;div className=&quot;min-h-screen bg-elkblue dark:bg-dark-pri&quot;&gt;
        marketing
      &lt;/div&gt;
    );
  }
  
  export async function getServerSideProps({ req }) {
    const { user } = await supabase.auth.api.getUserByCookie(req);
    if (user) {
      return {
        redirect: {
          destination: &quot;/admin&quot;,
          permanent: false,
        },
      };
    }
  
    return {
      props: {  }, // will be passed to the page component as props
    };
  }
  
  export default Home;
  </code></pre>