Open xodiumx opened 6 days ago
I think you can subclass AuthenticationBackend
to modify this.
But adding middlewares
to the init
is also fine by me. We just have to make it optional and initialize it when no argument is passed.
Feel free to create a PR for it.
Checklist
Is your feature related to a problem? Please describe.
Hi, was working on a task and ran into an issue where my application initializes two sessions.
AuthenticationBackend class creates its own session in the init method:
But if I need a session also in my application I initialize, when starting the app
and then I can't use session object from AuthBackend
Describe the solution you would like.
I think it would be more transparent to pass this middleware to the AuthenticationBackend, for example like this:
and initialize this middleware on application startup:
I hope this helps someone spend less time looking for the problem than it took me to find it 🥲