Allow the use of django.contrib.auth.login without credentials (authentication)
As it is we need to call authenticate
before login
because we need to set the authentication backend in the user model. We can use login without authenticate if we set the backend attr manually, but this need some implementation knowledge of how authentication works.
The proposal is to change the login
function signature to:
login(request, user, backend=None)
The following rules will apply:
- Use the value of the
backend
argument, if provided.
- Use the value of the
user.backend
annotation, if present.
- Use the only configured backend, if there is only one.
- Raise ValueError("You have multiple authentication backends configured; you must provide the backend argument to login.") otherwise.
More information can be found in the mailing list topic:
https://groups.google.com/forum/#!topic/django-developers/_I0BW5L7Z58
Change History
(11)
Owner: |
changed from nobody to Paulo Gabriel Poiati
|
Status: |
new → assigned
|
Triage Stage: |
Unreviewed → Accepted
|
Needs documentation: |
unset
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Patch: https://github.com/django/django/pull/5370