I want to generate a access token using refresh token
I’m using this built-in API View TokenRefreshView from simple-JWT
TokenRefreshView Response data structure
{
"access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY1NjQ5NDc1NSwiaWF0IjoxNjU2NDA4MzU1LCJqdGkiOiJhMgTA4ZWU0NDkyZGE0NTdmYjY2YmNiYjk0OGMxMWQ2OCIsInVzZXJfaWQiOjExNH0.Xj1hWggy8qzIGTRvXICsellVKm9bjyCeU-RIIu0xz1fQ"
}
But I want like this
"statusCode" : 200,
"status" : "success",
"message" : "Access token was created successfully",
"data" : {
"token" : {
"access" : "fasbniuhdfoauhrejbtoihaiuhdfiuasdhfinaihdfihafih"
}
}
I want to do like this how can i override that or how can create access token using refresh token
Simple-JWT Documentation
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"refresh":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX3BrIjoxLCJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImNvbGRfc3R1ZmYiOiLimIMiLCJleHAiOjIzNDU2NywianRpIjoiZGUxMmY0ZTY3MDY4NDI3ODg5ZjE1YWMyNzcwZGEwNTEifQ.aEoAYkSJjoWH1boshQAaTkf8G3yn0kapko6HFRt7Rh4"}' \
http://localhost:8000/api/token/refresh/
...
{"access":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX3BrIjoxLCJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiY29sZF9zdHVmZiI6IuKYgyIsImV4cCI6MTIzNTY3LCJqdGkiOiJjNzE4ZTVkNjgzZWQ0NTQyYTU0NWJkM2VmMGI0ZGQ0ZSJ9.ekxRxgb9OKmHkfy-zs1Ro_xs1eMLXiR17dIDBVxeT-w"}