app/controllers/nyauth/passwords_controller.rb in nyauth-0.2.8 vs app/controllers/nyauth/passwords_controller.rb in nyauth-0.3.0
- old
+ new
@@ -1,11 +1,9 @@
module Nyauth
class PasswordsController < ApplicationController
- include Nyauth::ApplicationConcern
- include Nyauth::ClientConcern
- include Nyauth::SessionConcern
- before_action -> { require_authentication! as: client_name }
+ include Nyauth::ControllerConcern
+ before_action -> { require_authentication! as: nyauth_client_name }
self.responder = Nyauth::AppResponder
respond_to :html, :json
before_action :set_client
@@ -13,20 +11,20 @@
end
def update
@client.attributes = client_params
@client.save(context: :update_password)
- respond_with(@client, location: Nyauth.configuration.redirect_path_after_update_password.call(client_name) || main_app.root_path)
+ respond_with(@client, location: Nyauth.configuration.redirect_path_after_update_password.call(nyauth_client_name) || main_app.root_path)
end
private
def set_client
- @client = client_class.find(current_authenticated.id)
+ @client = nyauth_client_class.find(current_authenticated.id)
end
def client_params
- params.fetch(client_name, {})
+ params.fetch(nyauth_client_name, {})
.permit(:password, :password_confirmation)
end
end
end