Skip to content

Commit d3435fe

Browse files
committed
refactor: broaden check for True values
1 parent e967c32 commit d3435fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ def save_bearer_token(self, token, request, *args, **kwargs):
480480

481481
# Users on older app versions should get long-lived tokens for
482482
# backwards compatibility.
483-
is_legacy_token = getattr(request, 'is_legacy_token') == 'True'
483+
TRUE_VALUES = [True, 'True', 'true']
484+
is_legacy_token = getattr(request, 'is_legacy_token') in TRUE_VALUES
484485

485486
if is_legacy_token:
486487
expire_seconds = oauth2_settings.LEGACY_ACCESS_TOKEN_EXPIRE_SECONDS

0 commit comments

Comments
 (0)