auth returns null on first call

When a user is logged in, db.auth.user() and db.auth.session() both return null initially. I can call it again later and it returns correctly, but not on initial page load. This also ruins nextjs auth helper withPageAuth where redirect to dashboard returns back saying no user but If I refresh the dashboard again sometimes it works and sometimes not.

Using nextjs v12 & supbase v1 thanks in advance
Was this page helpful?