Remove exception

This commit is contained in:
Micke Nordin 2024-01-13 16:21:55 +01:00
parent c143d96fab
commit 74e039809d
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257

View file

@ -33,6 +33,7 @@ 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']
@ -44,9 +45,6 @@ hub:
return False return False
print(f'Time is: {now}, token expires: {expires}') print(f'Time is: {now}, token expires: {expires}')
return True return True
except KeyError:
print(f'No auth_state available for user: {user.name}')
return False
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']