Authentication is essential for modern app development! In this video, Jon Meyers configures Supabase Auth to use cookies, and implements OAuth using GitHub in an Email Client, written with the Next.js App Router.
[ Ссылка ]
The Next.js App Router blurs the lines between Client and Server, therefore, Supabase Auth needs to be configured to use cookies, allowing the user and their session to be shared across the entire Next.js stack - Client Components, Server Components, Server Actions, Route Handlers and Middleware!
In this updated version, Jon refactors the logic for protecting pages to use Middleware, rather than a Layout.
📹 Full Next.js Email Client playlist: [ Ссылка ]
🧑💻 GitHub repo: [ Ссылка ]
00:00 The Right Way to do Auth with the Next.js App Router
00:44 Add Authentication with Next.js Server Actions and Supabase
03:52 Implement Protected Routes by Redirecting Unauthenticated Users
04:25 Using a Layout to protect a collection of routes
06:16 Use the @supabase/ssr package to configure cookie-based auth
09:07 Configure Proof Key for Code Exchange (PKCE) route
11:26 Use Middleware to refresh expired sessions
13:58 Move Protected Route logic to Middleware
15:42 Use the `with-supabase` template to skip this whole configuration
💻 Videos to watch next:
▶ Simplify complex SQL queries with Views in Postgres: [ Ссылка ]
▶ 3 reasons you should use Postgres Functions and Transactions: [ Ссылка ]
▶ Fastest way to build a SaaS with Next.js, Supabase and Stripe: [ Ссылка ]
👇 Learn more about Supabase 👇
🕸 Website: [ Ссылка ]
🏁 Get started: [ Ссылка ]
📄 Docs: [ Ссылка ]
🔔 Subscribe for more tutorials and feature updates from Supabase: [ Ссылка ]
📱 Connect with Us:
🐙 Github: [ Ссылка ]
💬 Discord: [ Ссылка ]
🐦 Twitter: [ Ссылка ]
📸 Instagram (follow for memes): [ Ссылка ]
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
Ещё видео!