We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I switched from django-rest-framework-jwt to django-rest-framework-simplejwt.
get_token
Problem: refresh the token just update the exp value. Is there a way to refresh custom claims with fresh data too ?
exp
The text was updated successfully, but these errors were encountered:
The only way to do that currently is to do something like this:
class MyRefreshSlidingSerializer(TokenRefreshSlidingSerializer): def validate(self, attrs): token = SlidingToken(attrs['token']) token.check_exp(api_settings.SLIDING_TOKEN_REFRESH_EXP_CLAIM) token.set_exp() # Do custom stuff here # ... return {'token': text_type(token)} class MyRefreshSlidingView(TokenViewBase): serializer_class = MyRefreshSlidingSerializer token_refresh_sliding = MyRefreshSlidingView.as_view()
Sorry, something went wrong.
No branches or pull requests
Hi,
I switched from django-rest-framework-jwt to django-rest-framework-simplejwt.
get_token
methods to add custom claims (first_name, last_name, ...)Problem: refresh the token just update the
exp
value. Is there a way to refresh custom claims with fresh data too ?The text was updated successfully, but these errors were encountered: