0

I am trying to update a user via PUT to /auth

via the docs:

Account updates. This route will update an existing user's account settings. The default accepted params are password and password_confirmation, but this can be customized using the devise_parameter_sanitizer system. If config.check_current_password_before_update is set to :attributes the current_password param is checked before any update, if it is set to :password the current_password param is checked only if the request updates user password.

It clearly needs something beyond just password and password_params as an identifier but neither email, id, or uid work. Also tried submitting with root user ie:

{ "user": { "email": "" } }

but this also does not work.

I cannot figure out what this is expecting. Not sure if I am missing something obvious. Could anyone give me an example of the json format which this is expecting?

Andrew
  • 942
  • 10
  • 26
  • I don't use Devise Token Auth (just plain old Devise), but what they are referring to is a Devise method `devise_parameter_sanitizer` which you must call and specify what properties of the user object are allowed to be updated. [More info](http://stackoverflow.com/q/19791531/398606). – Sunil D. Oct 07 '15 at 05:27
  • The format of the JSON object it's expecting is the usual format in rails, for example: `{ user: { email: 'f@foo.com', name: 'fred' } }` – Sunil D. Oct 07 '15 at 05:32
  • @SunilD. could you leave that as an actual answer? I'll try it later and if it works I will accept it – Andrew Oct 07 '15 at 19:54

0 Answers0