I have a NextJs application with its back-end in Laravel.
All of our Laravel api routes are protected with Laravel Sanctum to prevent XSS attacks.
The problem is that this auth method relies on sending cookies with each request. So when I try to make these requests from getStaticProps
function, I do not have cookies available.
What is best practice for this scenario? Disable sanctum for the specific routes needed in getStaticProps
? Or is there some black magic that will help me retrieve the needed cookies?