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

Cannot add more parameters at sign_up #22

Closed
smarquez1 opened this issue Aug 28, 2014 · 7 comments
Closed

Cannot add more parameters at sign_up #22

smarquez1 opened this issue Aug 28, 2014 · 7 comments

Comments

@smarquez1
Copy link

The devise way to add extra user parameters is not working right now, at least not on sign_up.
https://github.com/plataformatec/devise#strong-parameters

Unpermitted parameters: type, name
@lynndylanhurley
Copy link
Owner

Good catch. This gem should leverage devise's existing strong parameter system (it doesn't right now).

For now you can try overriding this method. I'll set this up ASAP.

@lynndylanhurley
Copy link
Owner

You should now be able to whitelist additional params using the existing devise conventions.

For example, if you want to allow users to specify their zodiac_sign at sign up:

class ApplicationController < ActionController::Base
  include DeviseTokenAuth::Concerns::SetUserByToken

  before_action :configure_permitted_parameters, if: :devise_controller?

  respond_to :json

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) << :zodiac_sign
  end
end

Please check out devise_token_auth version 0.1.27.beta2 and let me know if you run into any issues.

@smarquez1
Copy link
Author

Awesome! it works great, but somehow the 'auth:email-confirmation-success' is broken again, could you verify?

@lynndylanhurley
Copy link
Owner

I'll take a look ASAP.

@lynndylanhurley
Copy link
Owner

@smarquez1 - I just tested this with the version of your app that I cloned a few days ago. I updated the devise_token_auth gem to version 0.1.27.beta2, and the auth:email-confirmation-success is still firing properly.

Also, this update didn't touch anything related to client-side events. I haven't pulled your latest code, but something else on the front-end must be causing the issue.

@smarquez1
Copy link
Author

Thanks so much @lynndylanhurley it works now (I'm on beta3 btw).

@lynndylanhurley
Copy link
Owner

No problem! Thanks for pointing this out.

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