fastapi-users / fastapi-users-db-beanie

FastAPI Users database adapter for Beanie
MIT License
5 stars 5 forks source link

Incompatible with Beanie 1.18 #11

Closed bkis closed 1 year ago

bkis commented 1 year ago

Describe the bug

FastAPI-Users with fastapi-users-db-beanie seems to break when using the new Beanie release 1.18.
The Beanie dependency for this project is set as "beanie >=1.11.0,<2.0.0".

Any usage of (at least cookie-based) auth endpoints leads to:

  File "/home/user/.cache/pypoetry/virtualenvs/project-3OfolOSU-py3.10/lib/python3.10/site-packages/fastapi_users/authentication/strategy/db/strategy.py", line 46, in write_token
    return access_token.token
AttributeError: 'NoneType' object has no attribute 'token'

To Reproduce

Just use it with Beanie 1.18.

Expected behavior

Everything works as intended.

Configuration

frankie567 commented 1 year ago

Shall be fixed with fastapi-users-db-beanie==2.0.0.