From 711c3b516bf1893d73c66060065bcef610f7f02d Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 13 Jan 2024 15:30:12 +0100 Subject: [PATCH] Format --- jupyter/base/values/values.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/jupyter/base/values/values.yaml b/jupyter/base/values/values.yaml index 78a248c..8d27b90 100644 --- a/jupyter/base/values/values.yaml +++ b/jupyter/base/values/values.yaml @@ -13,19 +13,19 @@ hub: oauthCode: | from oauthenticator.generic import GenericOAuthenticator def post_auth_hook(authenticator, handler, authentication): - user = authentication['auth_state']['oauth_user']['ocs']['data']['id'] - auth_state = authentication['auth_state'] - authenticator.user_dict[user] = auth_state - return authentication + user = authentication['auth_state']['oauth_user']['ocs']['data']['id'] + auth_state = authentication['auth_state'] + authenticator.user_dict[user] = auth_state + return authentication class NextcloudOAuthenticator(GenericOAuthenticator): def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.user_dict = {} + super().__init__(*args, **kwargs) + self.user_dict = {} + def pre_spawn_start(self, user, spawner): - super().pre_spawn_start(user, spawner) - access_token = self.user_dict[user.name]['access_token'] - # refresh_token = self.user_dict[user.name]['refresh_token'] - spawner.environment['NEXTCLOUD_ACCESS_TOKEN'] = access_token + super().pre_spawn_start(user, spawner) + access_token = self.user_dict[user.name]['access_token'] + spawner.environment['NEXTCLOUD_ACCESS_TOKEN'] = access_token c.JupyterHub.authenticator_class = NextcloudOAuthenticator c.NextcloudOAuthenticator.client_id = os.environ['NEXTCLOUD_CLIENT_ID'] c.NextcloudOAuthenticator.client_secret = os.environ['NEXTCLOUD_CLIENT_SECRET']