Get user server-side on supabase js 2.0 + next.js

export const getServerSideProps = withPageAuth({
  redirectTo: '/',
  async getServerSideProps(ctx, supabase) {
    //const { user } = await getUser(ctx);
    // Find out how many words user is currently studying at novice level - maximum allowed is 200
    const { data } = await supabase
      .from('users_vocabulary')
      .select('*', { count: 'exact' })
      //.eq('B', user.id);
    return { props: { data } };
  }
});

The above code worked on the old version of supabase js, but I had to comment out the user selection to make it work on the new version. What is the new equivalent of
const { user } = await getUser(ctx);
?
Was this page helpful?