On Wednesday, March 30, 2016 at 4:06:41 AM UTC-4, killzane wrote:
>
> I use *@auth.requires_login()* in my controller
> and when I visit that page, I will auto go to login page and have the
> "_next URL parameter"
>
> I want to use
> auth.settings.login_next = URL('default', 'router')
>
> according to this page
> <http://web2py.com/books/default/chapter/29/09/access-control#Auth-Settings-and-messages>
> I
> need to set *referrer_actions *but I don't know where should I put this
> code?
> or It has other way to do it?
>
auth.settings.login_next is the default redirect location in case there is
*no* _next variable in the URL query string -- so that should already work
without any _next variable. By default, the auth.navbar adds a _next
variable to the login URL when the login link is clicked (so the user will
be redirected back to the page they were on before logging in) -- the _next
variable in the URL takes precedence over the auth.settings.login_next
setting, which only serves as a default. If you want to prevent auth.navbar
from adding the _next variable, you can use auth.navbar(...,
referrer_actions=None) wherever you have inserted the navbar (most likely
this would be in your layout.html). If that is not your goal, please
explain the behavior you are looking for and what you are seeing instead.
Anthony
--
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.