diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-17 10:50:46 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-24 16:52:49 -0700 |
commit | c9dec8b3cc2c2db306256d9eb12cdd44bf96a56c (patch) | |
tree | 920c805a5686ef56206173b67cbd6fb547cf2da3 /mediagoblin/auth/tools.py | |
parent | d93cd2684b484f925839574ce3bd6d58137066fa (diff) | |
download | mediagoblin-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.py | 6 |
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() |