jazzband / django-rest-knox

Authentication Module for django rest auth
MIT License
1.18k stars 213 forks source link

'str' object has no attribute 'decode' #183

Closed bymi15 closed 5 years ago

bymi15 commented 5 years ago

Line 64 in auth.py:

token = token.decode("utf-8")

I believe this line is not necessary in Python 3 and can be removed. It also causes the above error in some cases.

johnraz commented 5 years ago

Hello, thanks for the report. Feel free to open a pull request and add the appropriate test case, should be an easy first contrib !

bymi15 commented 5 years ago

Just figured it out! token is a token string encoded with: encode(HTTP_HEADER_ENCODING) which makes line 64: token = token.decode("utf-8") necessary.

TLDR: No changes needed. False report.