Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown trying to decode jwt #21

Closed
tmkontra opened this issue Dec 23, 2020 · 2 comments
Closed

Exception thrown trying to decode jwt #21

tmkontra opened this issue Dec 23, 2020 · 2 comments

Comments

@tmkontra
Copy link

File "./api/routes.py", line 38, in login
    token = login_manager.create_access_token(data=data, expires_delta=timedelta(days=30))
  File "/path/to/my/.venv/lib/python3.8/site-packages/fastapi_login/fastapi_login.py", line 165, in create_access_token
    return encoded_jwt.decode()
AttributeError: 'str' object has no attribute 'decode'

It looks like that line of code is assuming the encoded_jwt is bytes, but it looks like that method returns a string.

My Pipfile.lock resolved pyjwt to version ==2.0.0, I suppose this is a breaking change from 1.7.1, and I should restrict my Pipfile accordingly?

@MushroomMaula
Copy link
Owner

Thanks for raising awareness of this issue I 'm going to update pyjwt to its latest version and fix the error

@MushroomMaula
Copy link
Owner

I just updated the package and now everything should be working fine with the latest version of pyjwt

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

No branches or pull requests

2 participants