Use the Auth token in your server-side (Nodejs Tested)
This middleware is created to be integrated with NodeJS + Express + Supabase
- Copy the file where you want inside your project
- Import the file into the route you need to validate
const supabase_middleware = require('../config/supabase_middleware') - Invoke the middleware parsing
reqandres:const {user,supabase} = await supabase_middleware(req,res); - If the validation would be OK then you will get
userandsupabase, the user will contain the user details, supabase will be the istance with the current session to use for your next logical calls - If the validation would be KO then the middleware will automatically sent the error
- Login using the supabae.auth-signin
- Parse the
access_tokenundercurrentSessioninto Authentication: Bearer to your endpoint