Skip to content
Snippets Groups Projects
Commit 8543d55f authored by Lucas Ernesto Kindinger's avatar Lucas Ernesto Kindinger
Browse files

fix(User.singin): fix the 'configure_permitted_parameters' from user_controller

parent 376af60c
No related branches found
No related tags found
No related merge requests found
......@@ -23,13 +23,13 @@ class ApplicationController < ActionController::API
registration_params = [:name, :email, :avatar, :password, :password_confirmation]
if params[:action] == 'update'
devise_parameter_sanitizer.for(:account_update) {
|u| u.permit(registration_params << :current_password)
}
devise_parameter_sanitizer.permit(:account_update) do |user_params|
user_params.permit(registration_params << :current_password)
end
elsif params[:action] == 'create'
devise_parameter_sanitizer.for(:sign_up) {
|u| u.permit(registration_params << :terms_of_service)
}
devise_parameter_sanitizer.permit(:sign_in) do |user_params|
user_params.permit(registration_params << :terms_of_service)
end
end
end
......@@ -38,5 +38,4 @@ class ApplicationController < ActionController::API
def user_not_authorized
render nothing: true, status: :unauthorized
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment