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 address or username.
How can I add an additional authenticator to allow this? Thanks for the

from repoze.what.plugins.quickstart import setup_sql_auth
from ubercab.model.meta import Session
from ubercab.model.user import User
from ubercab.model.authorization import Group, Permission
def add_auth(app, skip_authentication):
    return setup_sql_auth(app, User, Group, Permission, Session,
        skip_authentication = skip_authentication,
        log_level = 'info',
        login_url = '/login',
        login_handler = '/authenticate',
        post_login_url = '/dashboard',
        logout_handler = '/logout',
        post_logout_url = '/login',
        cookie_secret = 'de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3',
        translations = {
            'user_name': 'username',
            'group_name': 'name',
            'permission_name': 'name'
Repoze-dev mailing list

Reply via email to