Skip to main content

Devise on Heroku

Rails • Asked by Moses Gathuku

Hello, I have been implementing device JWT with rails 6.0 API . I have used this callback to protect from fogery requests, On the applicationController

protect_from_forgery unless: -> { request.format.json? }

Its works well locally but when i diploy on heroku i get undefined method protect_from_fogery
and the app status changes from starting to crashed. When i remove it works fine but am not able to make JSON requests which it.
Error

/app/app/controllers/application_controller.rb:3:in `<class:ApplicationController>': undefined method `protect_from_fogery' for ApplicationController:Class (NoMethodError)

Devise -4.7.1
Rails API - 6.0


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.