Jupyter API token patch (#904)

This commit is contained in:
RoseGold 2023-02-09 21:13:12 +02:00 committed by GitHub
parent 269f5e7974
commit 7de0644eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -649,7 +649,8 @@ class ScriptInfo(object):
data={'_xsrf': cookies['_xsrf'], 'password': password})
cookies.update(r.cookies)
auth_token = server_info.get('token') or os.getenv('JUPYTERHUB_API_TOKEN') or ''
# get api token from ENV - if not defined then from server info
auth_token = os.getenv('JUPYTERHUB_API_TOKEN') or server_info.get('token') or ''
try:
r = requests.get(
url=server_info['url'] + 'api/sessions', cookies=cookies,