Commits

percious  committed 79b945f
  • Participants
  • Parent commits 28eeb65
  • Tags 2.1a3

Comments (0)

Files changed (2)

File tg/configuration.py

         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

File tg/tests/test_configuration.py

         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)