aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/auth/tools.py
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-05-17 10:50:46 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-05-24 16:52:49 -0700
commitc9dec8b3cc2c2db306256d9eb12cdd44bf96a56c (patch)
tree920c805a5686ef56206173b67cbd6fb547cf2da3 /mediagoblin/auth/tools.py
parentd93cd2684b484f925839574ce3bd6d58137066fa (diff)
downloadmediagoblin-c9dec8b3cc2c2db306256d9eb12cdd44bf96a56c.tar.lz
mediagoblin-c9dec8b3cc2c2db306256d9eb12cdd44bf96a56c.tar.xz
mediagoblin-c9dec8b3cc2c2db306256d9eb12cdd44bf96a56c.zip
log a previously logged in user when switched to no_auth mode
Diffstat (limited to 'mediagoblin/auth/tools.py')
-rw-r--r--mediagoblin/auth/tools.py6
1 files changed, 6 insertions, 0 deletions
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()