jpadilla / pyjwt

JSON Web Token implementation in Python
https://pyjwt.readthedocs.io
MIT License
5.08k stars 679 forks source link

type hint fix #771

Closed shai-loantz closed 2 years ago

shai-loantz commented 2 years ago

encode is returning a bytes object but the annotation suggests that it returns a str. Trying to send the token over the network ends up ruining the token. The fix is easy - applying token.decode('utf-8'), but it can only be used if the developer knows that encode returns bytes.