Hi Fran, I managed to fix the problem I think. When user is not authenticated the @auth.requires_login() decorator looks for settings.login_url from the Auth object. But i previously did not have that. After adding it, it worked fine Thanks
Regards, Winston On Sep 5, 3:04 pm, eddwinston <[email protected]> wrote: > Hi Fran, > > If I try to access the action with the @auth.requires_login() > decorator in the second controller, it still looks for user action in > the second controller. It does go to the on_failed_authorization url > given. > > On Sep 5, 2:20 pm, Fran <[email protected]> wrote: > > > On Sep 5, 12:10 pm, eddwinston <[email protected]> wrote: > > > > I have in my default controller the "user" action that exposes the > > > auth object. But I wanted authenticated also in a different > > > controller, say, second_controller. I decorated one of my action in > > > the "second_controller" with @auth.requires_login() and it was looking > > > for a "user" action in "second_controller". Do I still need to have an > > > action that will expose the auth object again in "second_controller"? > > > Add this to your model > > auth.settings.on_failed_authorization = URL(r=request, c='default', > > f='user', args='not_authorized') > > > F --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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 -~----------~----~----~----~------~----~------~--~---

