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

Unpermitted parameters: user, registration #104

Closed
ACPK opened this issue Jan 6, 2015 · 6 comments
Closed

Unpermitted parameters: user, registration #104

ACPK opened this issue Jan 6, 2015 · 6 comments

Comments

@ACPK
Copy link

ACPK commented Jan 6, 2015

I get an unpermitted parameters issues for "user, registration" when I try the curl command below:

curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST http://0.0.0.0:3000/auth -d "{\"user\":{\"email\":\"[email protected]\",\"password\":\"secret\"}}"

Error:

Processing by DeviseTokenAuth::RegistrationsController#create as JSON
  Parameters: {"user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}, "registration"=>{"user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}}}
Can't verify CSRF token authenticity

ActionController::UnpermittedParameters (found unpermitted parameters: user, registration):
  actionpack (4.1.8) lib/action_controller/metal/strong_parameters.rb:382:in `unpermitted_parameters!'
  actionpack (4.1.8) lib/action_controller/metal/strong_parameters.rb:275:in `permit'
  devise_token_auth (0.1.30) app/controllers/devise_token_auth/registrations_controller.rb:116:in `sign_up_params'
  devise_token_auth (0.1.30) app/controllers/devise_token_auth/registrations_controller.rb:9:in `create'
@ACPK
Copy link
Author

ACPK commented Jan 6, 2015

All set!

@ACPK ACPK closed this as completed Jan 6, 2015
@reydi
Copy link

reydi commented Feb 11, 2015

@ACPK What did you do?

@nicolas-besnard
Copy link
Contributor

I think he just remove the key "user" from his JSON
On Wed 11 Feb 2015 at 05:53 Reydi Sutandang [email protected]
wrote:

What did you do?


Reply to this email directly or view it on GitHub
#104 (comment)
.

@nicolas-besnard
Copy link
Contributor

curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST http://0.0.0.0:3000/auth -d "{\"email\":\"[email protected]\",\"password\":\"secret\"}"

@nicolas-besnard
Copy link
Contributor

@ACPK FYI: you don't need to espace JSON on your CURL command :)

@ACPK
Copy link
Author

ACPK commented Feb 24, 2015

@nicolas-besnard Here's the working line.

Curl http://test.com/auth --data "[email protected]&password=123456789&password_confirmation=123456789&first_name=John&last_name=Smith"

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

3 participants