Skip to content
Browse files

fixes persuant to: http://trac.turbogears.org/ticket/2414

  • Loading branch information...
1 parent 972bea9 commit dda8994ed147bc009e2516d472abad99a110c790 percious committed Nov 29, 2009
Showing with 7 additions and 1 deletion.
  1. +6 −1 tg/configuration.py
  2. +1 −0 tg/tests/test_configuration.py
View
7 tg/configuration.py
@@ -598,7 +598,12 @@ def add_auth_middleware(self, app, skip_authentication):
auth_args = copy(self.sa_auth)
if 'password_encryption_method' in auth_args:
del auth_args['password_encryption_method']
-
+ if not skip_authentication:
+ if not 'cookie_secret' in auth_args.keys():
+ msg = "base_config.sa_auth.cookie_secret is required "\
+ "you must define it in app_cfg.py or set "\
+ "sa_auth.cookie_secret in development.ini"
+ raise TGConfigError(msg)
app = setup_sql_auth(app, skip_authentication=skip_authentication,
**auth_args)
return app
View
1 tg/tests/test_configuration.py
@@ -119,6 +119,7 @@ class Dummy:pass
self.config.sa_auth.user_class = Dummy
self.config.sa_auth.group_class = Dummy
self.config.sa_auth.permission_class = Dummy
+ self.config.sa_auth.cookie_secret = 'dummy'
self.config.sa_auth.password_encryption_method = 'sha'
self.config.add_auth_middleware(None, None)

0 comments on commit dda8994

Please sign in to comment.
Something went wrong with that request. Please try again.