Right now i’m working on a site which uses the SQLAlchemyAuthenticatorPlugin. You need username and password to login.
I would like to add a login with email and password. So in the end it should be possible to use email/password or username/password to login.
Right now it looks like this:
sqlauth = SQLAlchemyAuthenticatorPlugin(model.User, model.meta.Session)
sqlauth.translations['user_name'] = 'email'
sql_user_md = SQLAlchemyUserMDPlugin(model.User, model.meta.Session)
sql_user_md.translations['user_name'] = 'email'
With sqlauth.translations i’m now able to successfully login with email/password. But of course username/password isn’t working anymore.
Any ideas on how to make both options work at the same time?
Thanks!
The SQLAlchemy plugins are fairly simple; you can either monkey-patch them or implement your own version of the plugins, like