I am trying to make the api call to pull the index from one of my models but I keep running into an unauthorized error. Yet, when I log in my user id, email and token all are logged in the console.
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
Weird error... because I am successfully making the api call for the specific users. I have tried several user logins successfully, and can successfully create a new sign up and log in with a token.
What is your best guess as to the source of the problem?
I think the issue is stemming from either a timing issue in react, or the user token is not recognized.
What things have you already tried to solve the problem?
I have tried setting state to a token within the signin to be able to pull the model data from the api with no luck. I have tried adding a authorization header to sign in and it does not like that... I have tried googling and applying solutions from there.
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
DR
What's the problem you're trying to solve?
I am trying to make the api call to pull the index from one of my models but I keep running into an unauthorized error. Yet, when I log in my user id, email and token all are logged in the console.
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
Weird error... because I am successfully making the api call for the specific users. I have tried several user logins successfully, and can successfully create a new sign up and log in with a token.
What is your best guess as to the source of the problem?
I think the issue is stemming from either a timing issue in react, or the user token is not recognized.
What things have you already tried to solve the problem?
I have tried setting state to a token within the signin to be able to pull the model data from the api with no luck. I have tried adding a authorization header to sign in and it does not like that... I have tried googling and applying solutions from there.
Paste a link to your repository here https://github.com/alquador/Project-4-Client