setup_storage)
from mediagoblin.tools.pluginapi import PluginManager, hook_transform
from mediagoblin.tools.crypto import setup_crypto
-from mediagoblin.auth.tools import check_auth_enabled
+from mediagoblin.auth.tools import check_auth_enabled, no_auth_logout
_log = logging.getLogger(__name__)
mg_request.setup_user_in_request(request)
+ # Log user out if in no_auth mode
+ no_auth_logout(request)
+
request.controller_name = None
try:
found_rule, url_values = map_adapter.match(return_rule=True)
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()