[web2py] Re: rediect after login when use decorators "@auth.requires_login"

2016-04-04 Thread Anthony
Are you saying if someone attempts to visit foo when they are not logged in, you want them to be directed to login, but then you *don't* want them to be redirected back to foo after the login? Why not? Why make them log in for foo if you're not going to take them back to foo after login?

[web2py] Re: rediect after login when use decorators "@auth.requires_login"

2016-03-30 Thread killzane
Thanks about explain it. this is code in my controller "default.py" @auth.required_login() def foo(): return 'this requires login' I use these code for visitor auto redirect to login page. and web2py will auto add *_next* variable then I can't use *auth.settings.login_next *to redirect

[web2py] Re: rediect after login when use decorators "@auth.requires_login"

2016-03-30 Thread Anthony
On Wednesday, March 30, 2016 at 4:06:41 AM UTC-4, killzane wrote: > > I use *@auth.requires_login()* in my controller > and when I visit that page, I will auto go to login page and have the > "_next URL parameter" > > I want to use > auth.settings.login_next = URL('default', 'router') > >