I'm using redux-token-auth with devise_token_auth. I can post to http://localhost:3000/api/v1/auth using curl or with Postman.
When I try to post to http://localhost:3000/api/v1/auth in my React class the request returns
Started POST "/api/v1/auth" for 127.0.0.1 at 2018-12-20 15:48:46 -0500
Processing by DeviseTokenAuth::RegistrationsController#create as JSON
Parameters: {"email"=>"sdfafsadfasdf@email.com", "password"=>"[FILTERED]", "full_name"=>"supersecret", "registration"=>{"email"=>"sdfafsadfasdf@email.com", "password"=>"[FILTERED]", "full_name"=>"supersecret"}}
Unpermitted parameters: :format, :registration
Unpermitted parameters: :format, :registration
Unpermitted parameters: :format, :registration
Completed 422 Unprocessable Entity in 126ms (Views: 7.1ms | ActiveRecord: 0.0ms)
I THINK this is because there is no confirm_success_url parameter. If I remove this param from my postman request it fails. I have set confirm_success_url in config/initializers/devise_token_auth.rbconfig.default_confirm_success_url = 'https://www.google.com'
Add confirm_success_url to userRegistrationAttributes in redux-token-auth-config
Add confirm_success_url to state in the React SignUpForm
Update the registerUser call to registerUser({ email, full_name, password, password_confirmation, confirm_success_url })
Param does not need to be whitelisted
I'm using
redux-token-auth
withdevise_token_auth
. I can post tohttp://localhost:3000/api/v1/auth
usingcurl
or with Postman.When I try to post to
http://localhost:3000/api/v1/auth
in my React class the request returnsI THINK this is because there is no
confirm_success_url
parameter. If I remove this param from my postman request it fails. I have setconfirm_success_url
inconfig/initializers/devise_token_auth.rb
config.default_confirm_success_url = 'https://www.google.com'
My
SignUpForm.js
Is
registerUser
not sending the param correctly?A workaround:
confirm_success_url
touserRegistrationAttributes
inredux-token-auth-config
confirm_success_url
to state in the React SignUpFormregisterUser
call toregisterUser({ email, full_name, password, password_confirmation, confirm_success_url })
Param does not need to be whitelisted