I think I misunderstood your answer the first time I read it.

Am Freitag, 27. Oktober 2017 15:39:33 UTC+2 schrieb Anthony:
>
> The Auth login method adds _next as a hidden input in the login form, so 
> _next ends up in both request.get_vars and request.post_vars. Because 
> request.vars combines get_vars and post_vars and each of those includes a 
> "_next" key, request.vars ends up with _next being a list including the 
> values from both get_vars and post_vars (which should be the same).
>
> So, if you just want _next from the URL query string, you can use 
> request.get_vars._next. But why do you need that -- the auth.login() action 
> already handles redirecting to the _next URL after successful login?
>

The authentication is done via ldap. The application is kind of a self 
service tool for our users. There are two kind of users, the ones already 
managed with the new tool and the ones that are not yet managed with the 
new tool (don't ask why).
First type of users shall log in and work with the front end, second type 
shall enter a registration process, that is handled in the back end. To 
distinguish the two of them, I introduced a function as login_onaccept hook 
that checks some ldap membership property, which is automatically handled 
by the back end. If they are not yet member of the "managed" group, the 
application redirects to the registration process.

Somehow I thought I would have to manually redirect the ordinary users, 
that's where I discovered, that the _next key was an array. Your answer 
made it clear, that I do not need to handle this case, but simply let the 
hook pass without doing anything and only redirect to the specific 
registration process in the second case.

Many thanks again,
Silvan
 

-- 
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