Add async interface to contrib.auth
This module currently doesn't offer a way to work with it directly asynchronously. Per the work in #31920 the middleware supports it, but if you need to directly call any of the functions you need to manually wrap them with the help of sync_to_async
.
There are several functions here that could use an async version:
authenticate
login
logout
get_user
update_session_auth_hash
I'd like to propose implementing them by just wrapping the synchronous versions (for now). Later on we can asyncify the internals down to the ORM. I've discussed doing this as part of a larger proposal at length here: https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-and-signals-and-maybe-sessions/18770
Change History
(8)
Cc: |
Carlton Gibson added
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Jon Janzen
|
Status: |
new → assigned
|
Needs documentation: |
set
|
Needs tests: |
set
|
Needs documentation: |
unset
|
Needs tests: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
PR