Set up a Login Page in Next.js with Supabase's auth.session()

Share this video with your friends

Send Tweet

In this lesson, we'll integrate supabase into a traditional frontend application, where we'll use it to set up a new authorization as well as building a basic login page with Next.js and Supabase's auth.session(). We'll use react hooks such as useEffect and useState to manage the state.

~ 2 years ago

There is no supabase.auth.session() function anymore. You need to use supabase.auth.getSession() which is a Promise. And that fails for me as it apparently cannot be part of the useState hook :/

Lucas Minter
~ 2 years ago

Thanks for bringing this to our attention! This is out of date because this course uses Supabase V1 where it's on V2. Here is a guide for Supabase Auth with Next.js for V2: https://supabase.com/docs/guides/auth/auth-helpers/nextjs.