-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support Devise Strong Parameters by Block #464
Comments
This is going much deeper than I thought. 👀 |
See also 5243f1a#diff-a2a19f583a3222656a65580ef78bde65R20 If we can't fix this in the short term, it'd be worth adding a note to the README about setting up the sanitizer correctly. |
Hi there @dmtroyer and @jamesdabbs , In an effort to cleanup this project and prioritize a bit, we're marking issues that haven't had any activity in a while with a "close-in-7-days" label. If we don't hear from you in about a week, we'll be closing this issue. Obviously feel free to re-open it at any time if it's the right time or this was done in error! If you are still having the issue (especially if it's a bug report) please refer to our new Issue Template to provide some more details to help us solve it. Hope all is well. |
ehm... I stumbled over this I only get the registration done when I change
|
Currently, the only way to customize accepted parameters using the
devise_parameter_sanitizer
is with simple scalar types, ala:Trying to do anything more complex by block as supported by Devise, won't work.
The reason is how
devise_token_auth
permits parameters by default atDeviseTokenAuth:: RegistrationsController.sign_up_params
:From my understanding, we should probably be using the
devise_parameter_sanitizer.sanitize()
method like in the originalDevise::RegistrationsController
:BUT, this doesn't work because the
Devise::ParameterSanitizer.resource_name
is not matching the request when it is referenced eventually atDevise::ParameterSanitizer.default_params
. It is looking for:api_user
but that is never in the params (from what I can tell, at least for registration) so calling thesanitize
method will always return an empty hash, hence the aforementionedsign_up_params
hack.Anyhow. I mostly wanted to document this so that when I dig deeper into it tomorrow I will remember what I spent all day on.
The text was updated successfully, but these errors were encountered: