jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 650 forks source link

How to get user details using token #425

Open roginthomas opened 6 years ago

roginthomas commented 6 years ago

I'm using angular 5 front end and django as back end. I use JWT token to communicate between django to angular. How can I get logged user details in backend using token.

EG: class PostSerializer(ModelSerializer): class Meta: model = PostDetail fields = [ 'title', 'upvote', ] Here upvote is a many to many field contain all voted user list. I want to add one more field "user_vote_status" to check the vote status of logged in user.

How can I figure out this issue, please help me.