Why you need cookie-based Auth for the Next.js App Router (2024)

Опубликовано: 06 Октябрь 2024
на канале: Supabase
35,069
507

The Next.js App Router makes it really easy to write client code - for things like realtime subscriptions - and server code - for things like data fetching.

In this video, Jon Meyers explains why you need cookies to implement Auth in mixed client/server environments 🚀.

▶ Read the docs: https://supabase.com/docs/guides/auth...

If you care about security in your app (which you should) - watch this…

Jon at Supabase is back showing us the power of (and explaining) integration of cookie-based authentication in mixed client/server environments using the Next.js App Router. Today, you’re going to learn why cookies are essential for authentication in modern web applications and how they facilitate secure and efficient user-specific data access also known as Row Level Security.

What You'll Learn:
✅ Understanding Next.js App Router: Discover how the Next.js App Router simplifies the development of server-side data fetching and client-side real-time subscriptions.

✅ Implementing Cookie-Based Authentication: Learn how to configure Supabase Auth to utilize cookies instead of local storage for maintaining user sessions across client and server environments.

✅ Row Level Security (RLS) in Supabase: Understand how to implement RLS to ensure that users can only access their specific data, enhancing application security. This basically makes EVERYTHING safer in your app.

✅ Enabling and Scoping RLS Policies: See how to enable read access for authenticated users and refine access controls using RLS policies to safeguard data so you don’t have to worry about it.

How This Helps You As A Developer Using Supabase:

By the end of this video, you'll know how to install authentication mechanisms in your web applications using Next.js and Supabase. The benefit here is that it not only makes for a more secure user experience but your data privacy and integrity are maintained across every user interaction.

00:00 Introduction
00:25 App without Authorization
00:53 Adding Authorization with Row Level Security (RLS)
01:24 Enabling read access with RLS policy
02:03 Scope RLS policy to signed in user
02:32 Cookie and session explanation
03:09 Configuring Supabase Auth to use Cookies
03:42 Next up: Implementing cookie-based Authentication

🧠 Full course:    • Cookie-based Auth and the Next.js App...  
💻 GitHub repo: https://github.com/dijonmusters/nextj...

💻 Videos to watch next:
▶ The RIGHT way to do Auth and Next.js:    • The Right Way to do Auth with the Nex...  
▶ FASTEST way to get started with Next.js and Supabase in 2024:    • Video  
▶ Local Development for SaaS product in 2024 // Next.js, Supabase and Stripe:    • Local Development for SaaS product in...  

👇 Learn more about Supabase 👇

🕸 Website: https://supabase.com/
🏁 Get started: https://app.supabase.com/
📄 Docs: https://supabase.com/docs

🔔 Subscribe for more tutorials and feature updates from Supabase:    / @supabase  

📱 Connect with Us:
🐙 Github: https://www.github.com/supabase
💬 Discord: https://discord.supabase.com/
🐦 Twitter:   / supabase  
▶ Instagram (follow for memes):   / supabasecom  


ABOUT SUPABASE:
Supabase is the open source Firebase alternative. Supabase provides a full Postgres database for every project with pgvector, backups, realtime, and more. Add and manage email and password, passwordless, OAuth, and mobile logins to your project through a suite of identity providers and APIs.

Build in a weekend, scale to millions.

#Supabase #AppDevelopment #RealtimeApps #DeveloperTools