Skip to content

Commit

Permalink
Add ReadOnlyField to TokenRefreshSerializer (#396)
Browse files Browse the repository at this point in the history
To make TokenRefreshSerializer be more descriptive, by adding access field as a ReadOnlyField()
  • Loading branch information
code-yeongyu committed Jun 6, 2021
1 parent 8a677b0 commit 0b8f3c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rest_framework_simplejwt/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def validate(self, attrs):

class TokenRefreshSerializer(serializers.Serializer):
refresh = serializers.CharField()
access = serializers.ReadOnlyField()

def validate(self, attrs):
refresh = RefreshToken(attrs['refresh'])
Expand Down

0 comments on commit 0b8f3c6

Please sign in to comment.