From cce9a772d6fe55c62368f6895492a8683e7b82ca Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 6 Mar 2024 13:35:07 +0300 Subject: Rename "__5_MINUTES__" to "EXPIRY_IN_SECONDS". * gn_auth/auth/authentication/oauth2/models/authorization_code.py (AuthorisationCode.__5_MINUTES__): Rename this to EXPIRY_IN_SECONDS. Signed-off-by: Munyoki Kilyungi --- gn_auth/auth/authentication/oauth2/models/authorization_code.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gn_auth/auth/authentication') diff --git a/gn_auth/auth/authentication/oauth2/models/authorization_code.py b/gn_auth/auth/authentication/oauth2/models/authorization_code.py index 55299cd..faffca1 100644 --- a/gn_auth/auth/authentication/oauth2/models/authorization_code.py +++ b/gn_auth/auth/authentication/oauth2/models/authorization_code.py @@ -11,7 +11,9 @@ from .oauth2client import OAuth2Client from ...users import User, user_by_id -__5_MINUTES__ = 300 # in seconds + +EXPIRY_IN_SECONDS = 300 # in seconds + class AuthorisationCode(NamedTuple): """ @@ -39,7 +41,7 @@ class AuthorisationCode(NamedTuple): def is_expired(self): """Check whether the code is expired.""" - return self.auth_time + __5_MINUTES__ < datetime.now().timestamp() + return self.auth_time + EXPIRY_IN_SECONDS < datetime.now().timestamp() def get_redirect_uri(self): """Get the redirect URI""" -- cgit v1.2.3