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 649 forks source link

setting JWT_PAYLOAD_GET_USER_ID_HANDLER ignored #380

Open SPKorhonen opened 6 years ago

SPKorhonen commented 6 years ago

User_id is read directly from payload leading to problems when using custom encoding on user_id field. Trivial fix: use api_settings.JWT_PAYLOAD_GET_USER_ID_HANDLER instead of payload.get('user_id'). Fixes issue #379

blueyed commented 6 years ago

Can you add a test, please?

SPKorhonen commented 6 years ago

Tests added to exercise the code paths within jwt_get_secret_key

paolodamico commented 6 years ago

Could you please merge this PR?