correct user passwd and sent json to front-end
This commit is contained in:
parent
5c8df7bafc
commit
129d68817e
|
@ -0,0 +1,15 @@
|
||||||
|
class Desktop::RegistrationsController < Devise::RegistrationsController
|
||||||
|
def update
|
||||||
|
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
|
||||||
|
|
||||||
|
if resource.update_with_password(params[resource_name])
|
||||||
|
set_flash_message :notice, :updated if is_navigational_format?
|
||||||
|
sign_in resource_name, resource, :bypass => true
|
||||||
|
render json: {success:true, msg: "Password successfully update!"}.to_json
|
||||||
|
else
|
||||||
|
clean_up_passwords(resource)
|
||||||
|
error_msg = resource.errors.full_messages.join("<br />")
|
||||||
|
render :json => {success: false, msg: error_msg}.to_json
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Reference in New Issue