From c9dec8b3cc2c2db306256d9eb12cdd44bf96a56c Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Fri, 17 May 2013 10:50:46 -0700 Subject: log a previously logged in user when switched to no_auth mode --- mediagoblin/auth/tools.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mediagoblin/auth/tools.py') diff --git a/mediagoblin/auth/tools.py b/mediagoblin/auth/tools.py index bd171261..7d051a66 100644 --- a/mediagoblin/auth/tools.py +++ b/mediagoblin/auth/tools.py @@ -76,3 +76,9 @@ def check_auth_enabled(): return False else: return True + + +def no_auth_logout(request): + """Log out the user if in no_auth mode""" + if not mg_globals.app.auth: + request.session.delete() -- cgit v1.2.3