Skip to content

Commit

Permalink
Add Social Path (#13)
Browse files Browse the repository at this point in the history
This adds a config option to specify the path to the social
module. This allows for custom auth backends for social auth.

Signed-off-by: David Brown <dmlb2000@gmail.com>
  • Loading branch information
dmlb2000 committed Nov 23, 2020
1 parent b2c16cf commit ff60e09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pacifica/auth/application.py
Expand Up @@ -62,7 +62,8 @@ def load_user():
'SOCIAL_AUTH_LOGIN_REDIRECT_URL': '/',
'SOCIAL_AUTH_TRAILING_SLASH': True,
'SOCIAL_AUTH_AUTHENTICATION_BACKENDS': (
'social_core.backends.{}.{}'.format(
'{}.{}.{}'.format(
configparser.get('cherrypy', 'social_path'),
configparser.get('cherrypy', 'social_module'),
configparser.get('cherrypy', 'social_class')
),
Expand Down
2 changes: 2 additions & 0 deletions pacifica/auth/config.py
Expand Up @@ -26,6 +26,8 @@ def common_config(configparser: ConfigParser):
'CHERRYPY_SOCIAL_MODULE', 'github'))
configparser.set('cherrypy', 'social_class', getenv(
'CHERRYPY_SOCIAL_CLASS', 'GithubOAuth2'))
configparser.set('cherrypy', 'social_path', getenv(
'CHERRYPY_SOCIAL_PATH', 'social_core.backends'))
configparser.add_section('social_settings')
configparser.add_section('database')
configparser.set('database', 'db_url', getenv(
Expand Down

0 comments on commit ff60e09

Please sign in to comment.