4
Basically I want to make all the routes that come from any http method (get, post, put, ...) pass, first, by a method that will make the verification if the user is authenticated, however, this method should not be called when the user will authenticate (method POST
route /auth
) and when it will register (method POST
route /user
). Remembering that I have other methods in the route /user
and other routes with the method POST
I would like a solution that does not involve calling a function in all necessary places, has how to do something like router.all()
or router.use()
in one place?
In this case the status is 401 (not authenticated), 403 is when the user is authenticated but has no permission
– Costamilam
Truth, my confusion. Fixed in response.
– BrunoRB