summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/__init__.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-03 21:18:10 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-03 21:18:10 -0800
commit03df0b8a6d1285fa4aa17e6c4216dd2716a9ac47 (patch)
treece6cc7f35a038ff5da26b86184d83441604de024 /python/fatcat_web/__init__.py
parent422a8cc47489aa44b852ff0add1ef6ea63cfc1ff (diff)
downloadfatcat-03df0b8a6d1285fa4aa17e6c4216dd2716a9ac47.tar.gz
fatcat-03df0b8a6d1285fa4aa17e6c4216dd2716a9ac47.zip
account page and renaming
Diffstat (limited to 'python/fatcat_web/__init__.py')
-rw-r--r--python/fatcat_web/__init__.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/python/fatcat_web/__init__.py b/python/fatcat_web/__init__.py
index 9cd5f812..0afee70e 100644
--- a/python/fatcat_web/__init__.py
+++ b/python/fatcat_web/__init__.py
@@ -23,21 +23,17 @@ oauth = OAuth(app)
sentry = Sentry(app)
conf = fatcat_client.Configuration()
-conf.host = "http://localhost:9411/v0"
+conf.host = Config.FATCAT_API_HOST
api = fatcat_client.DefaultApi(fatcat_client.ApiClient(conf))
+from fatcat_web import routes, auth
+
if Config.FATCAT_API_AUTH_TOKEN:
print("Found and using privileged token (eg, for account signup)")
- priv_conf = fatcat_client.Configuration()
- priv_conf.api_key["Authorization"] = Config.FATCAT_API_AUTH_TOKEN
- priv_conf.api_key_prefix["Authorization"] = "Bearer"
- priv_conf.host = 'http://localhost:9411/v0'
- priv_api = fatcat_client.DefaultApi(fatcat_client.ApiClient(local_conf))
+ priv_api = auth.auth_api(Config.FATCAT_API_AUTH_TOKEN)
else:
print("No privileged token found")
priv_api = None
-from fatcat_web import routes, auth
-
gitlab_bp = create_flask_blueprint(Gitlab, oauth, auth.handle_oauth)
app.register_blueprint(gitlab_bp, url_prefix='/auth/gitlab')