Skip to content

Commit

Permalink
Adding media_type in JWTAuthentication (#426)
Browse files Browse the repository at this point in the history
The drf render BrowsableAPIRenderer is requiring
a media_type object when generating a generic form
that includes a content type field, error will occur
if JWTAuthentication class does't have media_type.

Co-authored-by: Li Xin <tad.li@outlook.com>
  • Loading branch information
lizn520 and Li Xin committed Jun 27, 2021
1 parent 6520278 commit b06723f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rest_framework_simplejwt/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class JWTAuthentication(authentication.BaseAuthentication):
token provided in a request header.
"""
www_authenticate_realm = 'api'
media_type = 'application/json'

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down

0 comments on commit b06723f

Please sign in to comment.