diff --git a/setup.py b/setup.py index 2bf6aec..4e14a99 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ README = CHANGES = '' setup(name='velruse', - version='1.1.1', + version='1.1.2', description=( 'Simplifying third-party authentication for web applications.'), long_description=README + '\n\n' + CHANGES, diff --git a/velruse/app/__init__.py b/velruse/app/__init__.py index 51ec761..a862fb9 100644 --- a/velruse/app/__init__.py +++ b/velruse/app/__init__.py @@ -5,6 +5,8 @@ from pyramid.config import Configurator from pyramid.exceptions import ConfigurationError from pyramid.response import Response +from pyramid_beaker import session_factory_from_settings +from pyramid_beaker import BeakerSessionFactoryConfig from velruse.app.utils import generate_token from velruse.app.utils import redirect_form @@ -73,7 +75,6 @@ def default_setup(config): specified then an in-memory storage backend will be used. """ - from pyramid.session import UnencryptedCookieSessionFactoryConfig log.info('Using an unencrypted cookie-based session. This can be ' 'changed by pointing the "velruse.setup" setting at a different ' @@ -88,9 +89,11 @@ def default_setup(config): 'restarting the app.') secret = ''.join('%02x' % ord(x) for x in os.urandom(16)) log.info('autogenerated session secret: %s', secret) - factory = UnencryptedCookieSessionFactoryConfig( - secret, cookie_name=cookie_name) - config.set_session_factory(factory) + session_factory = BeakerSessionFactoryConfig( + key=cookie_name, + secret=secret, + ) + config.set_session_factory(session_factory) # setup backing storage storage_string = settings.get('store', 'memory')