for the record. i had to change this a bit to get it to work.
i was getting 'too many redirects' when i used this, so i changed it
to this:
(so it did not try to redirect when db.py was processing the 'login'
request)
if auth.user is None and 'login' not in request.args:
redirect(URL('default', 'user', args='login',
vars={'_next':request.url}))
the 'too many redirects' problem may only show in my setup because I
also have this in routes.py:
routes_in = ((r'/secure-login(?P<company>.*)', r'/myapp/default/user/
login\g<company>'),)
routes_out = ((r'/myapp/default/user/login(?P<company>.*)', r'/secure-
login\g<company>'),)
On Apr 5, 9:40 pm, pbreit <[email protected]> wrote:
> Slight correction:
>
> if auth.user is None:
> redirect(URL('default','user', args='login'))
>
> And if you want "next" functionality (not tested):
>
> if auth.user is None:
> redirect(URL('default','user', args='login', vars={'_next': request.url}
> ))