Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

flask-jwt-simple fail with python3.9 #20

Open
eamanu opened this issue Feb 11, 2021 · 1 comment · May be fixed by #21
Open

flask-jwt-simple fail with python3.9 #20

eamanu opened this issue Feb 11, 2021 · 1 comment · May be fixed by #21

Comments

@eamanu
Copy link

eamanu commented Feb 11, 2021

flask-jwt-simple fail with py3.9

self = <flask_jwt_simple.jwt_manager.JWTManager object at 0x7eff8c2092b0>
identity = 'username'

    def _create_jwt(self, identity):
        jwt_data = self._get_jwt_data(identity)
        secret = config.encode_key
        algorithm = config.algorithm
>       return jwt.encode(jwt_data, secret, algorithm).decode('utf-8')
E       AttributeError: 'str' object has no attribute 'decode'

flask_jwt_simple/jwt_manager.py:175: AttributeError

Original bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979713

@eamanu eamanu linked a pull request Feb 11, 2021 that will close this issue
@jferragut
Copy link

I am also experiencing this on python 3.8 with create method.

user = User.query.filter_by(email=email).first()
        if user.validate(password):
            response_msg = {'jwt': create_jwt(identity=email)}
            status_code = 200

results in:
"msg": "'str' object has no attribute 'decode'"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants