More debug
This commit is contained in:
parent
42e360ccec
commit
5ba9e626d3
|
@ -17,6 +17,7 @@ hub:
|
||||||
from oauthenticator.generic import GenericOAuthenticator
|
from oauthenticator.generic import GenericOAuthenticator
|
||||||
|
|
||||||
def get_nextcloud_access_token(refresh_token):
|
def get_nextcloud_access_token(refresh_token):
|
||||||
|
debug = 'NEXTCLOUD_DEBUG_OAUTH' in os.environ
|
||||||
client_id = os.environ['NEXTCLOUD_CLIENT_ID']
|
client_id = os.environ['NEXTCLOUD_CLIENT_ID']
|
||||||
client_secret = os.environ['NEXTCLOUD_CLIENT_SECRET']
|
client_secret = os.environ['NEXTCLOUD_CLIENT_SECRET']
|
||||||
|
|
||||||
|
@ -30,6 +31,8 @@ hub:
|
||||||
'client_secret': client_secret
|
'client_secret': client_secret
|
||||||
}
|
}
|
||||||
response = requests.post(url, data=data)
|
response = requests.post(url, data=data)
|
||||||
|
if debug:
|
||||||
|
print(response.text)
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
def post_auth_hook(authenticator, handler, authentication):
|
def post_auth_hook(authenticator, handler, authentication):
|
||||||
|
@ -103,7 +106,7 @@ hub:
|
||||||
c.NextcloudOAuthenticator.allow_all = True
|
c.NextcloudOAuthenticator.allow_all = True
|
||||||
c.NextcloudOAuthenticator.refresh_pre_spawn = True
|
c.NextcloudOAuthenticator.refresh_pre_spawn = True
|
||||||
c.NextcloudOAuthenticator.enable_auth_state = True
|
c.NextcloudOAuthenticator.enable_auth_state = True
|
||||||
c.NextcloudOAuthenticator.auth_refresh_age = 3600
|
c.NextcloudOAuthenticator.auth_refresh_age = 60
|
||||||
c.NextcloudOAuthenticator.post_auth_hook = post_auth_hook
|
c.NextcloudOAuthenticator.post_auth_hook = post_auth_hook
|
||||||
|
|
||||||
extraEnv:
|
extraEnv:
|
||||||
|
|
Loading…
Reference in a new issue