devise_token_auth icon indicating copy to clipboard operation
devise_token_auth copied to clipboard

null user attributes on email registration

Open kerolloz opened this issue 4 years ago • 1 comments

When a user registers using email, the values sent in JSON are not saved in the user object.

image

kerolloz avatar Apr 24 '21 11:04 kerolloz

@kerolloz Override the controller and specify the parameters you want to allow in the configure_permitted_parameters method

For more information, please see this.

class RegistrationsController < DeviseTokenAuth::RegistrationsController
  before_action :configure_permitted_parameters

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.permit(:sign_up, keys: %i(name nickname))
  end
end

muratiger avatar Apr 29 '21 15:04 muratiger