On Wednesday, May 22, 2013 8:20:54 AM UTC-4, Domagoj Kovač wrote:
> Looking at my function and your replies i can set:
> auth.settings.logout_next = URL("default", "login", "company")
> and this should redirect the user after he is logged out automatically.
>
Users are not logged out automatically (i.e., there isn't a spontaneous
logout as soon as the auth.settings.expiration amount of time passes). If a
user logs in and subsequently makes a request to a URL that requires login
after the login expiration, access will be denied, and they will instead be
redirected to auth.settings.login_url. In that case, the logout function is
not called and no logout event is logged. The logout action is only for
allowing the user to manually log out -- not for managing login expiration.
The above setting is only for redirecting the user after auth.logout() is
called.
> But this doesn't happen. Althought something like this should work i don't
> want to do it that way, i want to set default.logout as my application
> logout function, and all logouts are handled trough that function.
>
If you want /default/logout to be the logout URL, then just set that as the
URL when creating your logout links. Note, if you are using auth.navbar()
to generate Auth links, it expects all Auth actions to be routed through a
single function, with the first URL arg indicating the specific Auth
action. If you don't have that setup, then auth.navbar() won't work for
you. Note, currently auth.navbar() takes an "action" argument that let's
you specify the main Auth function, but you can't specify separate
functions for each Auth action. Perhaps we could allow "action" to be a
dict that would specify a different URL for each Auth action, which would
allow more flexibility. If interested in this, maybe open a Google Code
ticket about it.
Anthony
--
---
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/groups/opt_out.