-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for djangorestframework-simplejwt #76
Conversation
Oops, according to this: I think we should replace https://github.com/GetBlimp/django-rest-framework-jwt with https://github.com/davesque/django-rest-framework-simplejwt completely. Thanks for the PR! |
refresh = serializers.SerializerMethodField() | ||
|
||
@classmethod | ||
def get_token_instance(cls, user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be get_token
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this should be get_token_instance()
since otherwise it would conflict with the get_token()
used by the SerializerMethodField
in the SimpleJWTObtainSlidingSerializer
.
It should be changed in SimpleJWTBaseSerializer
token = serializers.SerializerMethodField() | ||
|
||
@classmethod | ||
def get_token_instance(cls, user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be get_token
?
rest_social_auth/serializers.py
Outdated
return str(self.token) | ||
|
||
|
||
class SimpleJWTObtainSlidingSerializer(serializers.Serializer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it is not inherit SimpleJWTBaseSerializer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Should be SimpleJWTBaseSerializer
3c9e769
to
7d1c1d7
Compare
I'm merging this, but unfortunately, the code is not fully correct. Will continue the work on that. |
Hi, I'd like to help out with this. Can you point me in the right direction on how the code is not fully correct? |
@basilbegonia @jgadelange If you fill like it wasn't correct or has errors, then fixes are welcome :) |
Since in the Rest Framework Documentation currently simplejwt is listed as package for implementing JWT with DRF I think this package should support that as wel.
This PR contains the necessary changes to support that. However, it does need an update to the README and should add some tests. Since I don't have the time right now to add those as well I added the PR without those.
Fixes #74