So if I understand this correctly, and also by looking at gluon/tools, setting session.auth = None is tantamount to logging someone off. And auth.log_event(...) is the way to add an entry to the event logger. Sweet and simple. Yes?
On Wednesday, March 28, 2012 9:05:38 AM UTC+8, Anthony wrote: > > On Tuesday, March 27, 2012 6:57:15 PM UTC-4, weheh wrote: >> >> I think I want a logout_bare() function so that I can logout via an ajax >> call without going through some contortions to avoid auth.logout()'s >> redirect. >> >> To be more specific, I want a link that says "logout". When clicked, it >> logs me out and executes an ajax callback rather than a redirect. >> > > I guess it wouldn't be too hard to write your own function in that case: > > def logout_bare(): > if auth.user: > auth.log_event(auth.messages.logout_log, auth.user) > session.auth = None > > Note, you may want to redirect to a non-protected page if the user happens > to be on a protected page when logging out. > > Anthony >

