How to disable in Devise handling of HTML and XML requests and leave JSON only?
I imagine you could override the Devise Controllers:
In controllers/devise_overrides/sessions_controller.rb
:
class DeviseOverrides::SessionsController < Devise::SessionsController
respond_to :json
respond_to :html, only: []
respond_to :xml, only: []
end
In routes.rb
:
devise_for :users, controllers: {
sessions: "devise_overrides/sessions"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With