Try to modify authstate after declaration
This commit is contained in:
parent
e3540011cf
commit
a2aa3d06f4
|
@ -13,10 +13,14 @@ hub:
|
||||||
oauthCode: |
|
oauthCode: |
|
||||||
import time
|
import time
|
||||||
from oauthenticator.generic import GenericOAuthenticator
|
from oauthenticator.generic import GenericOAuthenticator
|
||||||
|
|
||||||
def post_auth_hook(authenticator, handler, authentication):
|
def post_auth_hook(authenticator, handler, authentication):
|
||||||
user = authentication['auth_state']['oauth_user']['ocs']['data']['id']
|
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
|
return authentication
|
||||||
|
|
||||||
class NextcloudOAuthenticator(GenericOAuthenticator):
|
class NextcloudOAuthenticator(GenericOAuthenticator):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in a new issue