You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
If you look in your check expiry function you'll see that you're using time.time() to get the local server time, then evaluating that against the expiry. This is not correct as if you're running the webserver in a different timezone the times will no longer line up.
To correct this I think what is needed is to log time.time() when the request is made internally to create an offset and evaluate based off this.
The text was updated successfully, but these errors were encountered:
Here is my local solution, I'm not sure where you'd like to store the value or I'd implement it myself and push it. When I get/refresh my tokens I log the local time.
session['cognito_token_time'] = time.time()
Use test mode and apply the offeset if any:
#if token is expiring soon refresh and re-decode-verify
expiring_in = verified_claims['exp'] - time.time() - (verified_claims['auth_time'] - session['cognito_token_time'])
if(expiring_in < 0):
raise Exception('Token is expired')
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you look in your check expiry function you'll see that you're using time.time() to get the local server time, then evaluating that against the expiry. This is not correct as if you're running the webserver in a different timezone the times will no longer line up.
To correct this I think what is needed is to log time.time() when the request is made internally to create an offset and evaluate based off this.
The text was updated successfully, but these errors were encountered: