mirror of
https://github.com/django/django.git
synced 2025-10-27 07:36:08 +00:00
Fixed #31842 -- Added DEFAULT_HASHING_ALGORITHM transitional setting.
It's a transitional setting helpful in migrating multiple instance of the same project to Django 3.1+. Thanks Markus Holtermann for the report and review, Florian Apolloner for the implementation idea and review, and Carlton Gibson for the review.
This commit is contained in:
@@ -11,11 +11,14 @@ class PasswordResetTokenGenerator:
|
||||
reset mechanism.
|
||||
"""
|
||||
key_salt = "django.contrib.auth.tokens.PasswordResetTokenGenerator"
|
||||
algorithm = 'sha256'
|
||||
algorithm = None
|
||||
secret = None
|
||||
|
||||
def __init__(self):
|
||||
self.secret = self.secret or settings.SECRET_KEY
|
||||
# RemovedInDjango40Warning: when the deprecation ends, replace with:
|
||||
# self.algorithm = self.algorithm or 'sha256'
|
||||
self.algorithm = self.algorithm or settings.DEFAULT_HASHING_ALGORITHM
|
||||
|
||||
def make_token(self, user):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user