|
@@ -1,4 +1,23 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+from tg.util import Bunch
|
|
3
|
+
|
|
4
|
+_original_sa_auth = None
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+def _get_clean_sa_auth(config):
|
|
8
|
+ """
|
|
9
|
+ TODO COMMENT
|
|
10
|
+ :param config:
|
|
11
|
+ :return:
|
|
12
|
+ """
|
|
13
|
+ global _original_sa_auth
|
|
14
|
+
|
|
15
|
+ if _original_sa_auth is None:
|
|
16
|
+ _original_sa_auth = dict(config.get('sa_auth'))
|
|
17
|
+
|
|
18
|
+ sa_auth = Bunch()
|
|
19
|
+ sa_auth.update(_original_sa_auth)
|
|
20
|
+ return sa_auth
|
2
|
21
|
|
3
|
22
|
|
4
|
23
|
class Auth:
|
|
@@ -9,6 +28,8 @@ class Auth:
|
9
|
28
|
self._config = config
|
10
|
29
|
|
11
|
30
|
def wrap_config(self):
|
|
31
|
+ self._config['sa_auth'] = _get_clean_sa_auth(self._config)
|
|
32
|
+
|
12
|
33
|
# override this if you would like to provide a different who plugin for
|
13
|
34
|
# managing login and logout of your application
|
14
|
35
|
self._config['sa_auth'].form_plugin = None
|