class TurboFailureApp < Devise::FailureApp
def respond
if turbo_request?
redirect_for_turbo
else
super
class ApplicationController < ActionController::Base
before_action :authenticate_user!
rescue_from ActionController::InvalidAuthenticityToken do
handle_unauthenticated(reason: :csrf)
end