mirror of
https://github.com/norohind/FDEV-CAPI-Handler.git
synced 2025-06-06 18:33:12 +03:00
Refresh tokens earlyier than their full lifetime
This commit is contained in:
parent
17efd41457
commit
6a09c5b260
@ -125,7 +125,9 @@ class CAPIAuthorizer:
|
||||
|
||||
msg['state'] = state
|
||||
|
||||
if int(time.time()) < int(row['timestamp_got_expires_in']) + int(row['expires_in']) and not force_refresh:
|
||||
if int(time.time()) < int(row['timestamp_got_expires_in']) + int(row['expires_in'] - 400) and not force_refresh:
|
||||
# current time < when we got token + token lifetime - 400, 400 is need just to refresh token on 400 secs
|
||||
# earlier than lifetime stated by FDEV, for safe
|
||||
msg['status'] = 'ok'
|
||||
msg['description'] = "Didn't refresh since it isn't required"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user