Hi Anthony,

Thanks for you reply.

You're right the problem lay elsewhere.

My application's authentication and authorization is node- and function 
driven, on failed authentication
my application wasn't redirecting to user/login, when I set:

auth.settings.on_failed_authentication = URL('default','user/login') it did 
redirect properly, but lost _next

Adding vars=dict() solves the issue:

auth.settings.on_failed_authentication = URL('default','user/login', 
vars=dict(_next=URL(request.controller, request.function, 
args=request.args, vars=request.vars)))


Best,

Annet





On Saturday, 1 November 2014 03:34:00 UTC+1, Anthony wrote:
>
> What does on_login() do? Assuming it doesn't do a redirect, it shouldn't 
> interfere with the redirect to the _next URL (in which case, the problem 
> likely lies elsewhere).
>
> Anthony
>
> On Friday, October 31, 2014 4:20:58 AM UTC-4, Annet wrote:
>>
>> I have the follwoing auth settings:
>>
>>
>> auth.settings.login_next = URL('default', 'index')
>>
>> auth.settings.login_onaccept = lambda form: on_login()
>>
>> When the user visits:
>>
>> www.domain.com/my/group/confirm_connect/8/3
>>
>> without being logged in he is redirected to:
>>
>> www.domain.com/my/default/user/login
>>
>> after the user logs in he is redirect to
>>
>> www.domain.com/my/default/index not to 
>> www.domain.com/my/group/confirm_connect/8/3
>>
>> I thought request.vars._next would override auth.settings.login_next = 
>> URL('default', 'index')
>> but apparently auth.settings.login_onaccept = lambda form: on_login() 
>> interferes with
>> that behavior.
>>
>> Is there a fix to this issue?
>>
>>
>> Kind regards,
>>
>> Annet
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to