From a2aa3d06f440a113d5b2f317befdf088bd123815 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 13 Jan 2024 16:31:06 +0100 Subject: [PATCH] Try to modify authstate after declaration --- jupyter/base/values/values.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jupyter/base/values/values.yaml b/jupyter/base/values/values.yaml index 64a1813..6dbb98a 100644 --- a/jupyter/base/values/values.yaml +++ b/jupyter/base/values/values.yaml @@ -13,10 +13,14 @@ hub: oauthCode: | import time from oauthenticator.generic import GenericOAuthenticator + def post_auth_hook(authenticator, handler, authentication): user = authentication['auth_state']['oauth_user']['ocs']['data']['id'] - authentication['auth_state']['token_expires'] = time.time() + auth_state['token_response']['expires_in'] + auth_state = authentication['auth_state'] + auth_state['token_expires'] = time.time() + auth_state['token_response']['expires_in'] + authentication['auth_state'] = auth_state return authentication + class NextcloudOAuthenticator(GenericOAuthenticator): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)