Closed dmtroyer closed 8 years ago
issue in milestone is here: https://github.com/saxifrage/cityasacampus/issues/368
I'm running into an issue with permitting additional user fields at user registration. It seems similar to https://github.com/lynndylanhurley/devise_token_auth/issues/432
When I add one field at a time to the devise_parameter_sanitizer
it seems to work
devise_parameter_sanitizer.for(:sign_up) << :name
but when I try to pass it a block it doesn't permit the additional fields
devise_parameter_sanitizer.for(:sign_up) { |u| u.require(:name, :email, :password, :password_confirmation) }
I'm guessing it has something to do with the devise_token_auth
controller. Will dig :hammer:
Ok I think I realize what is going on.
The way devise_token_auth
calls devise_parameter_sanitizer.for(:sign_up)
will never hit the block that is used to register permitted parameters
def sign_up_params
params.permit(devise_parameter_sanitizer.for(:sign_up))
end
devise_token_auth
should be using the devise_parameter_sanitizer.sanitize(:sign_up)
method in RegistrationsController.sign_up_params
instead of the for
method
but Devise::ParameterSanitizer.resource_name
is :api_user
instead of :registrations
The issue on devise_token_auth
where I go into more detail https://github.com/lynndylanhurley/devise_token_auth/issues/464
!m @dmtroyer
Gee beez it this is up for review. I could have probably done more to directiveify the Organizer Registration view but I needed to draw the line somewhere and move on.
@dmtroyer the code looks excellent!
Comments:
I just amended your commit correcting a few areas not using string-based injection (please read "A Note on Minification" https://docs.angularjs.org/tutorial/step_05
Ah hah! Thanks for the link, I wondered why we were doing that :wink:
Your paths to the SVGs were incorrect so I fixed them :+1:
Shanks!
Let the user registration begin!