I have as much of my app accessible to anonymous users as possible.
However some areas require authentication, of course.
So I redirect users to 'login' if they try to access such functions.
This works fine, but after login they get dropped-back to the index
page for the controller, instead of where they were, which is annoying
as they have to click back through again.

I've looked at the T2 docs & code & see:
t2.login(self,next=’index’,onlogin=None)

'onlogin' looks promising as does request.vars._destination
However I can't see how to use these...no examples.

Trying something like this fails to do anything:
request.vars._destination='organisation'
t2.redirect('login')

t2.login() itself is only called once in the whole controller, so I
don't see how onLogin can be customised from the calling function.

Many thanks,
Fran.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to