Skip to content

Commit 4b373b4

Browse files
committed
fix: is_legacy_token default
1 parent d3435fe commit 4b373b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,9 @@ def save_bearer_token(self, token, request, *args, **kwargs):
481481
# Users on older app versions should get long-lived tokens for
482482
# backwards compatibility.
483483
TRUE_VALUES = [True, 'True', 'true']
484-
is_legacy_token = getattr(request, 'is_legacy_token') in TRUE_VALUES
484+
is_legacy_token = getattr(request, 'is_legacy_token', False)
485485

486-
if is_legacy_token:
486+
if is_legacy_token in TRUE_VALUES:
487487
expire_seconds = oauth2_settings.LEGACY_ACCESS_TOKEN_EXPIRE_SECONDS
488488
else:
489489
expire_seconds = app.access_token_expire_seconds

0 commit comments

Comments
 (0)