diff --git a/flask_jwt/__init__.py b/flask_jwt/__init__.py index f864b78..754568e 100644 --- a/flask_jwt/__init__.py +++ b/flask_jwt/__init__.py @@ -129,7 +129,12 @@ def _default_auth_request_handler(): def _default_auth_response_handler(access_token, identity): - return jsonify({'access_token': access_token.decode('utf-8')}) + try: + token = access_token.decode('utf-8') + except AttributeError: + # There is no str.decode method in Python 3, so we can use the access token directly + token = access_token + return jsonify({'access_token': token}) def _default_jwt_error_handler(error): diff --git a/requirements.txt b/requirements.txt index 953d69b..1f18ef5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ Flask>=0.9 -PyJWT>=1.4.0,<1.5.0 +PyJWT>=2.6.0