bradtraversy / lead_manager_react_django

Full stack app with React, Redux & Django
592 stars 316 forks source link

Workaround to account for breaking changes to django-rest-knox 4.0 (jan-19) #8

Open jakobskarin opened 5 years ago

jakobskarin commented 5 years ago

Breaking changes to Django-Rest-Knox in v 4.0.0.

knox.models.AuthToken.objects.create() now returns a tuple of the model instance and the token itself instead of just the token. A workaround has been made to address this.

From Django-Rest-Knox changelog:

4.0.0

BREAKING This is a major release version because it breaks the existing API.

Changes have been made to the create() method on the AuthToken model. It now returns the model instance and the raw token instead of just the token to allow the expiry field to be included in the success response.