Fixed #4819: documented the need to call authenticate() before login(), based on a patch from Davd Krauth.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
0e464d5d5c
commit
1087dc31fb
|
@ -337,6 +337,17 @@ This example shows how you might use both ``authenticate()`` and ``login()``::
|
||||||
else:
|
else:
|
||||||
# Return an 'invalid login' error message.
|
# Return an 'invalid login' error message.
|
||||||
|
|
||||||
|
.. admonition:: Calling ``authenticate()`` first
|
||||||
|
|
||||||
|
When you're manually logging a user in, you *must* call
|
||||||
|
``authenticate()`` before you call ``login()``; ``authenticate()``
|
||||||
|
sets an attribute on the ``User`` noting which authentication
|
||||||
|
backend successfully authenticated that user (see the `backends
|
||||||
|
documentation`_ for details), and this information is needed later
|
||||||
|
during the login process.
|
||||||
|
|
||||||
|
.. _backends documentation: #other-authentication-sources
|
||||||
|
|
||||||
Manually checking a user's password
|
Manually checking a user's password
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue