mirror of
https://github.com/django/django.git
synced 2025-10-27 15:46:10 +00:00
Fixed #10265: fixed a bug when generating a password reset token for a user created on the same request. Thanks, crucialfelix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -52,7 +52,7 @@ class PasswordResetTokenGenerator(object):
|
||||
# We limit the hash to 20 chars to keep URL short
|
||||
from django.utils.hashcompat import sha_constructor
|
||||
hash = sha_constructor(settings.SECRET_KEY + unicode(user.id) +
|
||||
user.password + unicode(user.last_login) +
|
||||
user.password + user.last_login.strftime('%Y-%m-%d %H:%M:%S') +
|
||||
unicode(timestamp)).hexdigest()[::2]
|
||||
return "%s-%s" % (ts_b36, hash)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user