On a side note, lets say you have a header template that contains a
form to log in.

This header template is included by multiple views, each with their
own controller.

It seems I need to pass auth.login() in the return dict for every
controller function using a view that includes the header template.
Is there a cleaner way to do this using decorators?

--
Daniel

On Jul 2, 8:50 am, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:
> On Thu, Jul 2, 2009 at 12:45, Jason Brower<encomp...@gmail.com> wrote:
> > Isn't there a way to redirect to a page after a successfullogin?
> > Regards,
> > Jason
>
> FromAuthclass we have:
>
>     deflogin(
>         self,
>         next=DEFAULT,
>         onvalidation=DEFAULT,
>         onaccept=DEFAULT,
>         log=DEFAULT,
>         ):
>
> ...
>                 redirect(next)
> ...
>
> So you must pass "next" attribute (it is a URL). You can use
> next=URL(r=request, a='myapp', c='mycontroller', f='myfunction').
>
> --
>  Álvaro Justen
>  Peta5 - Telecomunicações e Software Livre
>  21 3021-6001 / 9898-0141
>  http://www.peta5.com.br/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to