diff options
Diffstat (limited to 'gn_auth/auth')
-rw-r--r-- | gn_auth/auth/authentication/oauth2/models/authorization_code.py | 6 |
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""" |