You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a feature request suitable for implementation outside this project. Please elaborate what it is:
compatibility fix for new Django/Python version ...
other type of bug fix
other type of improvement
I have reduced the issue to the simplest possible case.
i have made different JWT authentications for different user models (admin and simple user). But the problem is that in settings.py the AUTH_USER_MODEL can only allow one user authentication.
Hence the problem appears where if i authenticate in admin section from admin credentials, then it doesn't allow and says invalid credentials. but if i authenticate in admin section from normal user credentials then it is allowed. because in settings.py the AUTH_USER_MODEL equals to users.User and not the other Admin User. please develop this new feature where we are allowed to have more than 1 AUTH_USER_MODELS in settings.py
The text was updated successfully, but these errors were encountered:
@MuhammadWaqarAnwar This is not a DRF limitation but a Django restriction. Django’s AUTH_USER_MODEL can only point to one user model, as it’s deeply integrated with the authentication system. To support multiple user models, you can use custom authentication backends or handle different user types (e.g., admin vs. regular users) within a single model or via separate views.
This could help: https://stackoverflow.com/a/65842734/5082800
Checklist
i have made different JWT authentications for different user models (admin and simple user). But the problem is that in
settings.py
theAUTH_USER_MODEL
can only allow one user authentication.Hence the problem appears where if i authenticate in admin section from admin credentials, then it doesn't allow and says invalid credentials. but if i authenticate in admin section from normal user credentials then it is allowed. because in
settings.py
theAUTH_USER_MODEL
equals tousers.User
and not the other Admin User. please develop this new feature where we are allowed to have more than 1AUTH_USER_MODELS
insettings.py
The text was updated successfully, but these errors were encountered: