comparison 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
comparison
equal deleted inserted replaced
2930:7c4eba7d31ff 2931:a6bb853c740b
17 from MoinMoin.util import monkeypatch 17 from MoinMoin.util import monkeypatch
18 18
19 from flask import Flask, request, session 19 from flask import Flask, request, session
20 from flask import current_app as app 20 from flask import current_app as app
21 from flask import g as flaskg 21 from flask import g as flaskg
22
23 # workaround Flask 0.10. incompatibility with openid - see #345, #515
24 try:
25 from flask_oldsessions import OldSecureCookieSessionInterface
26 except ImportError:
27 OldSecureCookieSessionInterface = None
22 28
23 from flask.ext.cache import Cache 29 from flask.ext.cache import Cache
24 from flask.ext.themes import setup_themes 30 from flask.ext.themes import setup_themes
25 31
26 from jinja2 import ChoiceLoader, FileSystemLoader 32 from jinja2 import ChoiceLoader, FileSystemLoader
66 into the moin configuration class (before its instance is created) 72 into the moin configuration class (before its instance is created)
67 """ 73 """
68 clock = Clock() 74 clock = Clock()
69 clock.start('create_app total') 75 clock.start('create_app total')
70 app = Flask('MoinMoin') 76 app = Flask('MoinMoin')
77
78 if OldSecureCookieSessionInterface:
79 app.session_interface = OldSecureCookieSessionInterface()
80
71 clock.start('create_app load config') 81 clock.start('create_app load config')
72 if flask_config_file: 82 if flask_config_file:
73 app.config.from_pyfile(flask_config_file) 83 app.config.from_pyfile(flask_config_file)
74 else: 84 else:
75 if not app.config.from_envvar('MOINCFG', silent=True): 85 if not app.config.from_envvar('MOINCFG', silent=True):