Class: DeviseIosRails::PasswordsController

Inherits:
Devise::PasswordsController
  • Object
show all
Includes:
SimpleTokenAuthentication::TokenAuthenticationHandler
Defined in:
app/controllers/devise_ios_rails/passwords_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/devise_ios_rails/passwords_controller.rb', line 7

def update
  respond_to do |format|
    format.html { super }
    format.json do
      super and return if authenticate_entity_from_token!(entity).nil?
      user = DeviseIosRails::ChangePasswordService.new(
        send("current_#{resource_name}"),
        params[resource_name]
      ).call!

      respond_with user
    end
  end
end