Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401 Unauthorized for get tasks and create task requests #31

Open
yogimathius opened this issue Jun 14, 2021 · 0 comments
Open

401 Unauthorized for get tasks and create task requests #31

yogimathius opened this issue Jun 14, 2021 · 0 comments

Comments

@yogimathius
Copy link

I have been trying to debug this on my end for the past few hours but to no success. Upon signing in with a user that I signed up with through the client, I get redirected to the signin page and there is a 401 unauthorized message in my console for the url http://localhost:3000/tasks.

It successfully signs me in with the JWT appearing in localstorage and a status in the result of 201 for the sign in request. I played around with the header in the FE to see if adding more configuration would open it up but unfortunately was not successful. I also added a configuration object to the enableCors method in the BE to see if adding authorization there would be fruitful but still nothing.

The fetchTasks axios request does not hit the back end at all. In my network tab I get a preflight with 204 status for tasks, then it goes to 401 for xhr. I've added loggers in all the endpoints of the get tasks function in the BE but don't receive any feedback in my terminal from requesting in the FE. Postman works fine with both of these requests, using the same user I created in the browser.

I cloned the repo provided for the BE with the branch "S8-bonus-frontend" with a fresh install and start to see if it was on my end somewhere but still getting unauthorized :(. I'd appreciate anything you can do to help remedy this, as I've really enjoyed the course and would love to wire it up to the FE that you are providing here. Thanks for your time and effort into making this excellent course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant