Change password in django rest framework
I am working on change password function for an API. My code runs fine locally. The problem is that when testing in postman I have to connect it using the login token. But in login, I have two passwords refresh and access. How should I configure Postman to give me access?
I was advised to use Bearer and accept allow_classes = [permissions.IsAuthenticated]
but when doing so, the login stops working and still cannot give access to password change.
First, you should write permission class in views as: permission_classes = (IsAuthenticated,)
Remember,you should know old password and got authenticated to change old password.
In postman, you see Authorization click on it and you see there is Type option, in Type option dropdown menu you should select Bearer Token then you see blank box in right side,put your access token there and hit send option it works fine.
If you need further reference then go on link below: https://medium.com/django-rest/django-rest-framework-change-password-and-update-profile-1db0c144c0a3