cubicweb/pyramid/login.py
branch3.24
changeset 11924 4c949c28ce59
parent 11816 6392f34fcdad
child 11967 83739be20fab
equal deleted inserted replaced
11923:acfb9aa4845e 11924:4c949c28ce59
    79     raise HTTPSeeOther('/')
    79     raise HTTPSeeOther('/')
    80 
    80 
    81 
    81 
    82 def includeme(config):
    82 def includeme(config):
    83     """ Create the 'login' route ('/login') and load this module views"""
    83     """ Create the 'login' route ('/login') and load this module views"""
       
    84     cwconfig = config.registry['cubicweb.config']
    84     config.add_route('login', '/login')
    85     config.add_route('login', '/login')
       
    86     if cwconfig.get('language-mode') == 'url-prefix':
       
    87         config.add_route('login-lang', '/{lang}/login')
       
    88         config.add_view(login_already_loggedin, route_name='login-lang',
       
    89                         effective_principals=security.Authenticated)
       
    90         config.add_view(login_form, route_name='login-lang')
       
    91         config.add_view(login_password_login, route_name='login-lang',
       
    92                         request_param=('__login', '__password'))
    85     config.scan('cubicweb.pyramid.login')
    93     config.scan('cubicweb.pyramid.login')