Skip to content

Commit

Permalink
Update protect_from_forgery to allow API request
Browse files Browse the repository at this point in the history
  • Loading branch information
B-Rass committed Oct 18, 2023
1 parent d1d3aa4 commit cdd4de7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ApplicationController < ActionController::Base

# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
protect_from_forgery with: :exception, unless: -> { request.format.json? }

rescue_from ActiveRecord::RecordNotFound, with: :show_not_found_error

Expand Down

0 comments on commit cdd4de7

Please sign in to comment.