Skip to content

Commit

Permalink
Fix issue with token generated as byte string
Browse files Browse the repository at this point in the history
This is related to jpadilla/pyjwt#319
  • Loading branch information
ylynfatt committed Mar 18, 2019
1 parent aba8361 commit 95260ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views.py
Expand Up @@ -92,7 +92,7 @@ def generate_token():
# logs into your web application and you send it back to the frontend
# where it can be stored in localStorage for any subsequent API requests.
payload = {'sub': '12345', 'name': 'John Doe'}
token = jwt.encode(payload, 'some-secret', algorithm='HS256')
token = jwt.encode(payload, 'some-secret', algorithm='HS256').decode('utf-8')

return jsonify(error=None, data={'token': token}, message="Token Generated")

Expand Down

0 comments on commit 95260ea

Please sign in to comment.