Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow additional parameters for registration #25

Closed
markusklooth opened this issue Sep 9, 2014 · 3 comments
Closed

Allow additional parameters for registration #25

markusklooth opened this issue Sep 9, 2014 · 3 comments

Comments

@markusklooth
Copy link

When signing up via email, I would like to send additional parameters such as image. I was trying to subclass the DeviseTokenAuth::RegistrationsController and change the resource_params function. This doesn't work because the devise_for is setup in ActionDispatch::Routing::Mapper -> mount_devise_token_auth_for

devise_for resource.pluralize.underscore.to_sym,
          :class_name  => resource,
          :module      => :devise,
          :path        => "",
          :controllers => { :registrations => "devise_token_auth/registrations"}
end

Is there anyway we could allow for additional parameters to be send?
Maybe even in the initializer such as

DeviseTokenAuth.setup do | config |
  config.registration_params = [:image]
end

And then in controllers/devise_token_auth/registrations_controller

def resource_params

   params.permit(:email, :password, :password_confirmation, :confirm_success_url, :confirm_error_url, *DeviseTokenAuth.registration_params)
end
@lynndylanhurley
Copy link
Owner

This was solved with #22.

In short, you should be able to configure the params whitelist using devise's recommended approach.

@markusklooth
Copy link
Author

Oh damn should’ve checked the closed issues.

Markus Klooth, E.I.T
Project Engineer
Webcor Concrete, 1751 Harbor Bay Parkway, Suite 200, Alameda, CA 94502
C 510-205-5536 www.webcor.com

On Sep 9, 2014, at 3:21 PM, Lynn Dylan Hurley notifications@github.com wrote:

This was solved with #22.

In short, you should be able to configure the params whitelist using devise's recommended approach.


Reply to this email directly or view it on GitHub.

@lynndylanhurley
Copy link
Owner

No problem 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants