I solved:
vars={'_next':request.env.request_uri}
(auth.user or request.args(0) == 'login') or\
redirect(URL('default', 'user', args='login', vars=vars))
On Tuesday, June 3, 2014 5:12:06 PM UTC-5, Omar Meat Boy Gutiérrez wrote:
>
>
> I am using Google OAuth to login in my app.
>
> In `default/index.html` I have some buttons (as a menu), each button have
> a link to specific controller.
>
> When I click on one of those buttons, my app go to 'default/user/login'.
>
> After login process I am being redirected to `default/index.html`. I'd
> like to be redirected to the link I clicked.
>
> I tried the following, I have the next lines in each controller:
>
> vars={'controller': request.controller,
> 'function':request.function}
> (auth.user or request.args(0) == 'login') or\
> redirect(URL('default', 'user', args='login', vars=vars))
>
> In the `user` function in `default.py` controller I have:
>
> controller = request.vars['controller']
> function = request.vars['function']
>
> if request.args(0) == 'login':
> auth.settings.login_next = URL(controller, function)
>
> I receive 'None' and 'None' however.
>
> Which is the way to redirect to the correct controller instead of
> 'default/index' after login process with Google OAuth?
>
> Greetings
>
>
>
--
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.