Webpack Devise Sessions

Hi,

I’m trying to get a component on the webpack dev server to POST to my Rails server, and send the Devise remember_user_token cookie.

I’ve gotten close:

config/environments/development:
config.action_dispatch.default_headers.merge!({
‘Access-Control-Allow-Origin’ => ‘’,
‘Access-Control-Request-Method’ => '

})

app/controllers/application_controller.rb:

skip_before_action :verify_authenticity_token if Rails.env.development?

In my JS code:
return fetch(‘http://localhost:4000/gyms/crossfit-antarctica/gym_signins’, {
method: ‘post’,
mode: ‘no-cors’,
credentials: ‘include’,
body: JSON.stringify({myparam: 1})
})

This almost works…my only issue is the params are not being delivered to the Rails controller. Any ideas?

If you create a minimal prototype repo on github, we may be able to help.