mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #31375 -- Made contrib.auth.hashers.make_password() accept only bytes or strings.
This commit is contained in:
parent
b3ab92cc5a
commit
8aa71f4e87
4 changed files with 24 additions and 6 deletions
|
@ -402,12 +402,16 @@ from the ``User`` model.
|
|||
.. function:: make_password(password, salt=None, hasher='default')
|
||||
|
||||
Creates a hashed password in the format used by this application. It takes
|
||||
one mandatory argument: the password in plain-text. Optionally, you can
|
||||
provide a salt and a hashing algorithm to use, if you don't want to use the
|
||||
defaults (first entry of ``PASSWORD_HASHERS`` setting). See
|
||||
:ref:`auth-included-hashers` for the algorithm name of each hasher. If the
|
||||
password argument is ``None``, an unusable password is returned (one that
|
||||
will never be accepted by :func:`check_password`).
|
||||
one mandatory argument: the password in plain-text (string or bytes).
|
||||
Optionally, you can provide a salt and a hashing algorithm to use, if you
|
||||
don't want to use the defaults (first entry of ``PASSWORD_HASHERS``
|
||||
setting). See :ref:`auth-included-hashers` for the algorithm name of each
|
||||
hasher. If the password argument is ``None``, an unusable password is
|
||||
returned (one that will never be accepted by :func:`check_password`).
|
||||
|
||||
.. versionchanged:: 3.1
|
||||
|
||||
The ``password`` parameter must be a string or bytes if not ``None``.
|
||||
|
||||
.. function:: is_password_usable(encoded_password)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue