Using Rails 5 beta3 API mode.
Getting this error when trying to do a get request to /users/sign_in route
Hey! I'm having the same problem
How did you fix this?
+1. How did you fix this?
I had same problem, but succeeded to fix it.
ApplicationController usually extends ActionController::Base.
On Rails5 API mode, however, ApplicationController extends ActionController::API, which does not include ActionController::RequestForgeryProtection.
In order to fix, I inserted config.parent_controller = 'ActionController::Base' into config/initializers/devise.rb.
How you configure to all others actions to respond to JSON instead HTML when you changed to config.parent_controller = 'ActionController::Base'?
@rodriggochaves
I don't longer use devise with Rails5 API mode, so not remember well what I did...
I recognize that config/initializers/devise.rb effects only modoules which relate to devise,
so I think config.parent_controller = 'ActionController::Base' not change other controller's work.
if you will use Rails5 API mode, I recommend to devise_token_auth. I already use it.
Most helpful comment
I had same problem, but succeeded to fix it.
ApplicationController usually extends ActionController::Base.
On Rails5 API mode, however, ApplicationController extends ActionController::API, which does not include ActionController::RequestForgeryProtection.
In order to fix, I inserted
config.parent_controller = 'ActionController::Base'into config/initializers/devise.rb.