File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -396,11 +396,15 @@ def is_expired(self):
396
396
now = timezone .now ()
397
397
is_refresh_token_expired = now >= expires
398
398
399
+ # Access token assumed to be expired, by default.
400
+ is_access_token_expired = True
401
+
399
402
# RefreshToken should not outlive AccessToken.
400
403
# NOTE: Check AccessToken expiration for backwards compatibility with
401
404
# long-lived tokens.
402
- access_token_expires = self .access_token .expires
403
- is_access_token_expired = now >= access_token_expires
405
+ if self .access_token :
406
+ access_token_expires = self .access_token .expires
407
+ is_access_token_expired = now >= access_token_expires
404
408
405
409
# RefreshToken expired if and only if both refresh and access tokens
406
410
# are expired.
You can’t perform that action at this time.
0 commit comments