You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using "redux-token-auth": "^0.19.0" with devise_token_auth. I may be missing something but I think this is something faced by others as well (#28 and #34 for reference). #34 is almost the exact issue I am facing but there is no conclusion on that thread (whether this is expected behavior or if the library handles the auth headers between the requests).
I have been able to set up sign_in/sign_up/sign_out easily but when it comes to sending requests to protected routes on my API I end up with 401 response. The reason, auth headers are not added to the axios requests for those protected routes (routes wrapped up under before_action: authenticated_user! callback).
During initial debugging I used postman with headers extracted from my localstorage and request went fine. It is mentioned in #34 that this library handles addition of auth headers out of the box but I don't think that is the case or I may be missing something.
For now, after spending a lot of hours going through the docs, a few online examples (which only cover authentication and no subsequent request) and any related issues I am inclined to add the the headers as suggested in a few ways on #28. However, I still assume the library must have the functionality to handle this as well.
Furthermore, I request there should be some information about requests made by client to protected resources in the docs.
The text was updated successfully, but these errors were encountered:
import axios from 'redux-token-auth/node_modules/axios';
...
axios.defaults.headers.common
This lets me get the redux-token-auth axios headers and do what I want with them. This library needs a major refactor so it isn't relying on axios, in such an integrated way, or at least let you pass in an axios instance, but currently there is no development going on there.
I am using
"redux-token-auth": "^0.19.0"
withdevise_token_auth
. I may be missing something but I think this is something faced by others as well (#28 and #34 for reference). #34 is almost the exact issue I am facing but there is no conclusion on that thread (whether this is expected behavior or if the library handles theauth headers
between the requests).I have been able to set up sign_in/sign_up/sign_out easily but when it comes to sending requests to protected routes on my API I end up with
401
response. The reason,auth headers
are not added to the axios requests for those protected routes (routes wrapped up underbefore_action: authenticated_user!
callback).During initial debugging I used postman with headers extracted from my localstorage and request went fine. It is mentioned in #34 that this library handles addition of
auth headers
out of the box but I don't think that is the case or I may be missing something.For now, after spending a lot of hours going through the docs, a few online examples (which only cover authentication and no subsequent request) and any related issues I am inclined to add the the headers as suggested in a few ways on #28. However, I still assume the library must have the functionality to handle this as well.
Furthermore, I request there should be some information about requests made by client to protected resources in the docs.
The text was updated successfully, but these errors were encountered: