Can I protect a specific route?


#1

Hello! I want to protect a specific route. Is posible? For example, /products. Some suggestion?

Regards
Emiliano


#2

Yes, you would add a middleware to that route.


#3

Hi @tflight ! Thanks for your comment!

In my case I implemented Slim CSRF and I want to protect the route that generate a security token. I don’t know if the correct way…

Example:

/generateToken (the access should be protected)

/products (checks a security token)

In conclusion, I want to protect my api… Some suggestion?


#4