mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-22 00:43:28 +00:00
make PASSWORD_RESET_TIMEOUT_DAYS default 3
This commit is contained in:
parent
d5636f28ce
commit
ed9eee950f
@ -1,11 +1,11 @@
|
||||
# Copyright (c) 2012-2016 Seafile Ltd.
|
||||
from datetime import date
|
||||
from django.conf import settings
|
||||
from django.utils.http import int_to_base36, base36_to_int
|
||||
from django.utils.crypto import constant_time_compare, salted_hmac
|
||||
import six
|
||||
from seahub.base.models import UserLastLogin
|
||||
|
||||
|
||||
class PasswordResetTokenGenerator(object):
|
||||
"""
|
||||
Strategy object used to generate and check tokens for the password
|
||||
@ -38,7 +38,7 @@ class PasswordResetTokenGenerator(object):
|
||||
return False
|
||||
|
||||
# Check the timestamp is within limit
|
||||
if (self._num_days(self._today()) - ts) > settings.PASSWORD_RESET_TIMEOUT_DAYS:
|
||||
if (self._num_days(self._today()) - ts) > 3:
|
||||
return False
|
||||
|
||||
return True
|
||||
@ -77,4 +77,5 @@ class PasswordResetTokenGenerator(object):
|
||||
# Used for mocking in tests
|
||||
return date.today()
|
||||
|
||||
|
||||
default_token_generator = PasswordResetTokenGenerator()
|
||||
|
Loading…
Reference in New Issue
Block a user