Previously, the logic to actually check for an API key was in the EE version of optional_user_. This meant that for MIT users, the API keys would never work.
Additionally, in this PR I switched to use an async engine. Due to FastAPI Users, this flow must be async, and it's generally good practice to use async engines during async flows to avoid mistakenly blocking the event loop.
Previously, the logic to actually check for an API key was in the EE version of
optional_user_
. This meant that for MIT users, the API keys would never work.Additionally, in this PR I switched to use an async engine. Due to FastAPI Users, this flow must be async, and it's generally good practice to use async engines during async flows to avoid mistakenly blocking the event loop.