fix refresh

This commit is contained in:
norohind 2021-12-08 00:55:42 +03:00
parent 3571e7b070
commit 2e04c92402
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

View File

@ -142,8 +142,13 @@ class CAPIAuthorizer:
refresh_request.raise_for_status()
tokens = refresh_request.json()
tokens['timestamp_got_expires_in'] = int(time.time())
self.model.set_tokens(*tokens, state)
self.model.set_tokens(
access_token=tokens["access_token"],
refresh_token=tokens["refresh_token"],
expires_in=tokens["expires_in"],
timestamp_got_expires_in=int(time.time()),
state=state
)
msg['status'] = 'ok'
msg['description'] = 'Token were successfully updated'
return msg