django rest and react - request.user is "Annonymous user"

Viewed 14

I have used simple JWT for authentication and i have successfully logged in and am getting tokens also. But when i do a request.user in backend i get "Annonymous user".

Tried passing Authorization header in axios post in FE REACT but it throws error. Am setting both refresh and access in a state variable and store it in local storage . Am really new into this and I'm totally stuck here.

All i did was to temporarily solve the issue is to send the user id from frontend to backend and by the way it's a bad practice as said by someone

0 Answers
Related