web2py version 1.98.2

If a custom url is set for login_url (via auth.settings.login_url) and no 
arg is passed, auth() does not honor login_url and redirects to url based on 
controller set while initializing Auth()
e.g. 

auth=Auth(globals(),db) 
auth.settings.login_url = URL(request.application, c='c', f='user', 
args='login')

Assuming application to be 'init' url /init/c/user is redirected to 
/init/default/user/login. 

Code from gluon/tools.py
(lines 1101 on 
http://code.google.com/p/web2py/source/browse/gluon/tools.py#1101)

def __call__(self):
"""
usage:

def authentication(): return dict(form=auth())
"""

request = current.request
args = request.args
if not args:
redirect(self.url(args='login',vars=request.vars))
....

Should not there be a check on auth.setting.login_url before regenerating 
login url if no args are passed?

Reply via email to