All threads / Devise on Heroku

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Devise on Heroku

Moses Gathuku asked in Rails

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

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 38,558+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.