aboutsummaryrefslogtreecommitdiff
path: root/src/web/lib/user_utils.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-18 21:41:50 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-18 21:41:50 +0100
commita2336c5de836267a4e88961422fc3f26cedab47e (patch)
tree18dbc1fb5d09cba02f5c54cae764f3610570d3ff /src/web/lib/user_utils.py
parentfix migration script (diff)
downloadnewspipe-a2336c5de836267a4e88961422fc3f26cedab47e.tar.gz
newspipe-a2336c5de836267a4e88961422fc3f26cedab47e.tar.bz2
newspipe-a2336c5de836267a4e88961422fc3f26cedab47e.zip
we now specify the validity period of the activation link.
Diffstat (limited to 'src/web/lib/user_utils.py')
-rw-r--r--src/web/lib/user_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/web/lib/user_utils.py b/src/web/lib/user_utils.py
index d5c3da22..dfeb8dfa 100644
--- a/src/web/lib/user_utils.py
+++ b/src/web/lib/user_utils.py
@@ -1,7 +1,7 @@
from itsdangerous import URLSafeTimedSerializer
-
+import conf
from bootstrap import application
@@ -10,13 +10,13 @@ def generate_confirmation_token(email):
return serializer.dumps(email, salt=application.config['SECURITY_PASSWORD_SALT'])
-def confirm_token(token, expiration=3600):
+def confirm_token(token):
serializer = URLSafeTimedSerializer(application.config['SECRET_KEY'])
try:
email = serializer.loads(
token,
salt=application.config['SECURITY_PASSWORD_SALT'],
- max_age=expiration
+ max_age=conf.TOKEN_VALIDITY_PERIOD
)
except:
return False
bgstack15