next.js
1da90c27 - Clean up with-supabase example (#61799)

Commit
1 year ago
Clean up with-supabase example (#61799) ### What? [1] Clean up `with-supabase` example following patterns from @leerob's recent video on authentication [2] Add images to matcher to reduce number of times a session is refreshed [3] Move instantiation of `cookieStore` into Supabase server helper ### Why? [1] Make template easier to understand and use [2] Reduce likelihood users will receive Auth Rate Limit Exceeded error [3] Makes creating a Supabase client much simpler in Server Components, Route Handlers and Server Actions ### How? [1] Refactor middleware and its helper function [2] Add image extensions to middleware matcher [3] Call `cookies()` function from `createClient` helper - this should still be in the [same execution context](https://nextjs.org/docs/messages/dynamic-server-error) and appears to work from my testing, but would be good to get the 👍 from someone at Vercel
Author
Parents
Loading