Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
percious committed Nov 29, 2009
1 parent 972bea9 commit dda8994
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tg/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tg/tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dda8994

Please sign in to comment.