aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authentication/oauth2
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-03-06 13:35:07 +0300
committerMunyoki Kilyungi2024-03-08 15:03:52 +0300
commitcce9a772d6fe55c62368f6895492a8683e7b82ca (patch)
tree126d11177a3d324a2aa76cf728a6a8f2acf3782a /gn_auth/auth/authentication/oauth2
parentfb015a2c4a6b176030e29bdc299c5213200dcf29 (diff)
downloadgn-auth-cce9a772d6fe55c62368f6895492a8683e7b82ca.tar.gz
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 <me@bonfacemunyoki.com>
Diffstat (limited to 'gn_auth/auth/authentication/oauth2')
-rw-r--r--gn_auth/auth/authentication/oauth2/models/authorization_code.py6
1 files changed, 4 insertions, 2 deletions
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"""