Supabase
NEMO middleware functions for Supabase
Installation
Integrate Supabase with your project using the official guides:
Supabase Quickstart or Supabase Next.js App
We will only make one small change to make it work with NEMO.
Integrate NEMO with Supabase middleware
Create _middleware.ts
.
Create a new file in your projects lib or supabase directory called _middleware.ts
.
And paste middleware code that you've copied from the Supabase documentation.
It should look like this:
Integrate supabase middleware with NEMO
We need to change params implementation in updateSession
function to use MiddlewareFunctionProps
type.
Replace middleware.ts
code
We need to edit primary middleware.ts
file to use the new middleware function.
(Optional) Add user infomation to context
To add user information to the context, you can use the following code: