The simple JWT document says we can customize token claims from TokenObtainPairSerializer -> get_token class method.
However, if we customize the token according to the above document and enable the blacklist app, the token stored in the OutstandingToken model is different. Because the BlacklistMixin -> for_user is executed before modifying the token.
If the tokens are different, it will be difficult in identifying the token while blacklisting.
Reference:
|
OutstandingToken.objects.create( |
|
user=user, |
|
jti=jti, |
|
token=str(token), |
|
created_at=token.current_time, |
|
expires_at=datetime_from_epoch(exp), |
|
) |