Closed alessandro-pianetta closed 4 years ago
The issues your raising don't appear to have anything to do with this module. If you have found a reproducible problem with this module, please open an issue with a succinct code example and/or detailed instructions to reproduce.
For general debugging and coding help consider resources like Stack Overflow.
I used this tutorial to implement auth in my server. For the authenticated GET and DELETE routes I have defined, it's working like a charm. However, when I try to send a POST or PATCH request to an authenticated route, for some strange reason it defaults to the first authenticated route I defined, a GET route. I then get a 401 error saying "Cannot GET [route for the POST request I initiated]".
I use some wrappers around my DB call using axios.[get/post/etc] to set the headers/have my database's URL pre-loaded in, and I've confirmed that the headers are correct right before I actually make the call. In my dev tools though, I don't see the Authorization header actually go through. I would think it's a problem of my headers not being properly set, but I use the exact same pattern for PATCH and DELETE (with the only difference being the axios method) and the headers don't show up in the request for the former, but do for the latter, so I'm kind of stuck.
Can anyone help me figure out what's going wrong?