I'm using Django REST along with Djoser as my authentication service. However, when making a post request to the djoser auth endpoints, e.g. .../auth/token/login
, the only response I get back is auth_token: xxxxx
E.g, if I make a successful post request such as:
{
"username": "[email protected]",
"password": "test12345"
}
My response will be
"auth_token": "XXXXXXXX"
But I'd like to retrieve more than just a token, e.g.
"auth_token": "XXXXXXXX",
"user_id": 8
Any idea on how to make this happen?
.../auth/token/login
with a username and password - if that password and username are valid, I get back a response in the form of"auth_token": "xxxxx"
. I'd like to get back something like"auth_token": "xxxx", "user_id": 8
– erikvm