Remove exception
This commit is contained in:
parent
c143d96fab
commit
74e039809d
|
@ -33,20 +33,18 @@ hub:
|
||||||
async def refresh_user(self, user, handler=None):
|
async def refresh_user(self, user, handler=None):
|
||||||
auth_state = await user.get_auth_state()
|
auth_state = await user.get_auth_state()
|
||||||
if not auth_state:
|
if not auth_state:
|
||||||
|
print(f'auth_state missing for {user}')
|
||||||
return False
|
return False
|
||||||
access_token = auth_state['access_token']
|
access_token = auth_state['access_token']
|
||||||
refresh_token = auth_state['refresh_token']
|
refresh_token = auth_state['refresh_token']
|
||||||
token_response = name]['token_response']
|
token_response = name]['token_response']
|
||||||
now = time.time()
|
now = time.time()
|
||||||
expires = self.user_dict[user.name]['token_expires']
|
expires = self.user_dict[user.name]['token_expires']
|
||||||
if now >= expires:
|
if now >= expires:
|
||||||
print(f'Time is: {now}, token expired: {expires}')
|
print(f'Time is: {now}, token expired: {expires}')
|
||||||
return False
|
|
||||||
print(f'Time is: {now}, token expires: {expires}')
|
|
||||||
return True
|
|
||||||
except KeyError:
|
|
||||||
print(f'No auth_state available for user: {user.name}')
|
|
||||||
return False
|
return False
|
||||||
|
print(f'Time is: {now}, token expires: {expires}')
|
||||||
|
return True
|
||||||
|
|
||||||
c.JupyterHub.authenticator_class = NextcloudOAuthenticator
|
c.JupyterHub.authenticator_class = NextcloudOAuthenticator
|
||||||
c.NextcloudOAuthenticator.client_id = os.environ['NEXTCLOUD_CLIENT_ID']
|
c.NextcloudOAuthenticator.client_id = os.environ['NEXTCLOUD_CLIENT_ID']
|
||||||
|
|
Loading…
Reference in a new issue