diff MoinMoin/app.py @ 2931:a6bb853c740b

fix logon with openid 2.0, fixes #345
author RogerHaase <haaserd@gmail.com>
date Tue, 21 Apr 2015 15:22:02 -0700
parents da84a2c42a92
children 4ab27780d078
line wrap: on
line diff
--- a/MoinMoin/app.py	Tue Apr 21 15:09:02 2015 -0700
+++ b/MoinMoin/app.py	Tue Apr 21 15:22:02 2015 -0700
@@ -20,6 +20,12 @@
 from flask import current_app as app
 from flask import g as flaskg
 
+# workaround Flask 0.10. incompatibility with openid - see #345, #515
+try:
+    from flask_oldsessions import OldSecureCookieSessionInterface
+except ImportError:
+    OldSecureCookieSessionInterface = None
+
 from flask.ext.cache import Cache
 from flask.ext.themes import setup_themes
 
@@ -68,6 +74,10 @@
     clock = Clock()
     clock.start('create_app total')
     app = Flask('MoinMoin')
+
+    if OldSecureCookieSessionInterface:
+        app.session_interface = OldSecureCookieSessionInterface()
+
     clock.start('create_app load config')
     if flask_config_file:
         app.config.from_pyfile(flask_config_file)