Skip to content

Commit

Permalink
This is just a simple update on the knox authentication where the tok…
Browse files Browse the repository at this point in the history
…en created is a tuple consisting of a token and instance variable. This prevents the token to be serialized.Here is the update
  • Loading branch information
bernie-haxx committed May 15, 2019
1 parent 6ba9a67 commit 8f90a12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rest_social_auth/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ class KnoxSerializer(TokenSerializer):
def get_token(self, obj):
try:
from knox.models import AuthToken
from knox.settings import knox_settings
except ImportError:
warnings.warn('django-rest-knox must be installed for Knox authentication', ImportWarning)
raise

token = AuthToken.objects.create(obj)
instance, token = AuthToken.objects.create(obj,knox_settings.TOKEN_TTL)
return token


Expand Down

0 comments on commit 8f90a12

Please sign in to comment.