How to protect API routes ? #4797
-
Hello, I am new to Next Auth.
Here A user can log in with google if they are on the list, also season gets updated with their roles. I authenticate a user in getServerSideProps like this
Everything works fine. But in this setup, how I could a protect an API route ?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
My current solution : When fetching data send cookie
In API middileware
|
Beta Was this translation helpful? Give feedback.
My current solution :
When fetching data send cookie