diff options
author | Frederick Muriuki Muriithi | 2025-03-14 10:14:47 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-03-14 10:14:47 -0500 |
commit | bb6a77dfcb553fcabfff8a3337a569f9e30b6f16 (patch) | |
tree | 7dcb9511e7c4bf884d39b79889c080c48387bbcb /gn_auth | |
parent | b5168265af4a80733efe2f8cf5d61639de00a326 (diff) | |
download | gn-auth-bb6a77dfcb553fcabfff8a3337a569f9e30b6f16.tar.gz |
Move expiry of auth-based emails into a config variable.
To ease setting up of value without changing code, move the value out
into a configuration variable.
Diffstat (limited to 'gn_auth')
-rw-r--r-- | gn_auth/auth/authorisation/users/views.py | 4 | ||||
-rw-r--r-- | gn_auth/settings.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py index 2140928..f2e89cc 100644 --- a/gn_auth/auth/authorisation/users/views.py +++ b/gn_auth/auth/authorisation/users/views.py @@ -125,7 +125,7 @@ def send_verification_email( subject="GeneNetwork: Please Verify Your Email" verification_code = secrets.token_urlsafe(64) generated = datetime.now() - expiration_minutes = 15 + expiration_minutes = current_app.config["AUTH_EMAILS_EXPIRY_MINUTES"] def __render__(template): return render_template(template, subject=subject, @@ -380,7 +380,7 @@ def send_forgot_password_email( subject="GeneNetwork: Change Your Password" token = secrets.token_urlsafe(64) generated = datetime.now() - expiration_minutes = 15 + expiration_minutes = current_app.config["AUTH_EMAILS_EXPIRY_MINUTES"] def __render__(template): return render_template(template, subject=subject, diff --git a/gn_auth/settings.py b/gn_auth/settings.py index d561fa9..d59e997 100644 --- a/gn_auth/settings.py +++ b/gn_auth/settings.py @@ -45,3 +45,7 @@ SMTP_TIMEOUT = 200 # seconds SMTP_USER = "no-reply@genenetwork.org" SMTP_PASSWORD = "asecrettoken" EMAIL_ADDRESS = "no-reply@uthsc.edu" + + +## Variable settings for various emails going out to users +AUTH_EMAILS_EXPIRY_MINUTES = 15 |