Skip to content

Commit 7d3621a

Browse files
committed
Update doc for jwt example to omit b2s() if pyjwt version >= 2.0.0
[skip ci] jwt.encode() changed return type in 2.0.0 from byte to string.
1 parent d57034e commit 7d3621a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/rest.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,8 @@ only been tested with python3)::
19261926
secret = self.db.config.WEB_JWT_SECRET
19271927
myjwt = jwt.encode(claim, secret, algorithm='HS256')
19281928

1929+
# if jwt.__version__ >= 2.0.0 jwt.encode() returns string
1930+
# not byte. So do not use b2s() with newer versions of pyjwt.
19291931
result = {"jwt": b2s(myjwt),
19301932
}
19311933

0 commit comments

Comments
 (0)