Closed nejdetkadir closed 8 months ago
Assuming you have an attribute 'name' and 'address' for your model 'user', you can do the following:
class Api::V1::Users::TokensController < Devise::Api::TokensController
private
def sign_up_params
params.permit(:name, :address, *resource_class.authentication_keys,
*::Devise::ParameterSanitizer::DEFAULT_PERMITTED_ATTRIBUTES[:sign_up]).to_h
end
end
Hey @1gn0r4nd, I'm having the same issue. I tried that code and but it's still not working. I have some questions regarding this:
Sorry for the questions, I'm kind of new in RoR. Thanks in advance.
The devise-api gem currently only allows for email and password fields during user registration through the API. It would be useful to have the ability to specify additional fields that are required or accepted during registration, such as name or address. This would provide more flexibility in terms of user registration through the API. It would be great if this feature could be added to the gem.