Re: [Repoze-dev] enabling login with username or email + password

2010-10-03 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/02/2010 03:32 PM, Ryan McKillen wrote: I'm using the Quickstart plugin with Pyloins. My auth.py is pasted below. I'm authenticating against a username filed in my database, but I'd like to give users the option of logging in with their email

Re: [Repoze-dev] enabling login with username or email + password

2010-10-03 Thread Gustavo Narea
Hello, Another option is to create an authenticator like this: from repoze.who.plugins.sa import SQLAlchemyAuthenticatorPlugin from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound class UsernameOrEmailAuthenticator(SQLAlchemyAuthenticatorPlugin): def authenticate(self,