Use access token again

This commit is contained in:
Micke Nordin 2024-01-15 12:07:53 +01:00
parent 755b165302
commit ff10e706cd
Signed by untrusted user: Micke
GPG key ID: F53C4CC83EDAB3BE

View file

@ -33,7 +33,6 @@ hub:
if not auth_state:
return
access_token = auth_state['access_token']
access_token = auth_state['refresh_token']
spawner.environment['NEXTCLOUD_ACCESS_TOKEN'] = access_token
async def refresh_user(self, user, handler=None):
@ -50,6 +49,8 @@ hub:
now_hr = datetime.fromtimestamp(now)
expires = auth_state['token_expires']
expires_hr = datetime.fromtimestamp(expires)
if debug:
print(f'auth_state for {user}: {auth_state}')
if now >= expires:
if debug:
print(f'Time is: {now_hr}, token expired: {expires_hr}')