We've moved discussions to Discord

Unpermitted parameters not allowing sign up (name, terms_of_service and time_zone

Darren Smyth
Hi

I'm at a loss to know why Devise isn't accepting the parameters name, terms of service and time zone.

The error I'm getting when I'm trying to create an account is:

Started POST "/users" for ::1 at 2021-01-30 18:28:29 +1100Processing by Users::RegistrationsController#create as TURBO_STREAMParameters: {"authenticity_token"=>"XXX", "user"=>{"name"=>"[FILTERED]", "email"=>"[FILTERED]", "password"=>"[FILTERED]", "time_zone"=>"Melbourne", "terms_of_service"=>"1"}, "g-recaptcha-response"=>"                ", "tezcirmnf-v"=>""}Unpermitted parameters: :name, :time_zone, :terms_of_service

Here is my application controller:

def configure_permitted_parameters
  extra_keys = [:avatar, :preferred_language]
  signup_keys = extra_keys + [:invite, :name, :time_zone, :terms_of_service, owned_accounts_attributes: [:name]]
  devise_parameter_sanitizer.permit(:sign_up, keys: signup_keys)
  devise_parameter_sanitizer.permit(:account_update, keys: extra_keys)
  devise_parameter_sanitizer.permit(:accept_invitation, keys: extra_keys)
end

Does it have something to do with the params being part of the users attribute?

I'm also getting validation errors when I've ticked the Terms of Service and provided a name.

image.png 44.6 KB


I haven't changed anything from the devise sign up form ... I think it's the default JSP one.

Thanks for any help in getting this working.

Darren
Darren Smyth
It appears it had nothing to do with Devise and everything to do with using the capcha gem. Removed it and it now works.
Hi Darren, I'm getting this same error on signups. So I followed the recaptcha setup instructions using the gem 'recaptcha'. Is that the gem you used and then removed? So removing it then nothing works?
Darren Smyth
Hi  Mark . I removed the capcha gem which was installed and the signup worked as it was meant to.
Notifications
You’re not receiving notifications from this thread.