Get user server-side on supabase js 2.0 + next.js
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 ?
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 } };
}
});const { user } = await getUser(ctx);