3

I'm using devise_token_auth gem in my Rails 5 API application. For testing all devise token routes i use Postman. When I try to update a user account using PUT method on route "https://localhost:3000/auth", I fill the body of request with that:

{"data":{"name":"user1"}} 

or

{"user":{"name":"user1"}} 

the response comes back with "success" status and JSON representation of a user with the same (not updated) "name" attribute.

Does it mean that devise_token_auth does not provide such functionality and a have to overrride the User controller and a model ?

1 Answers1

0

the first step is get tokens valids and after add the headers in the PUT request and add in the body this json format:

{ "name": "newname" }

The URL for login in devise token is:

http://localhost:3000/auth/sign_in

enter image description here

For update params for example name copy in the body and do not forget add the values in the header

enter image description here

enter image description here

I hope you solve your problem

Omar Duarte
  • 666
  • 7
  • 5