You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BeanieBaseUserDocument defines 2 indexes on the email field , one being a unique index and the other being a collation. However only the collation index is applied to the email field in the database. This means that multiple users with the same emaill can end up in the database.
To Reproduce
To make reproducing this simpler i have lifted the BeanieBaseUserDocument model directly from this repo and put it into a minimal example.
Describe the bug
BeanieBaseUserDocument defines 2 indexes on the email field , one being a unique index and the other being a collation. However only the collation index is applied to the email field in the database. This means that multiple users with the same emaill can end up in the database.
To Reproduce
To make reproducing this simpler i have lifted the BeanieBaseUserDocument model directly from this repo and put it into a minimal example.
Model from
fastapi-users-db-beanie/fastapi_users_db_beanie/__init__.py
Line 16 in eedd103
The behavior is not as expected:
Expected behavior
The database should prevent duplicate emails from being added via the indexes.
Additional context
Software versions
The text was updated successfully, but these errors were encountered: