Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/idv/in_person/usps_locations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def handle_error(err)
Faraday::TimeoutError => :unprocessable_entity,
Faraday::BadRequestError => :unprocessable_entity,
Faraday::ForbiddenError => :unprocessable_entity,
ActionController::InvalidAuthenticityToken => :unprocessable_entity,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a controller-level

protect_from_forgery with: :reset_session

so that it never throws an error in the first place?

https://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html#method-i-protect_from_forgery

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure on the best strategy since this is an API and mostly copied what's already here, I'm primarily wanting to not return a 500. I'd defer to the folks on Joy.

}[err.class] || :internal_server_error

analytics.idv_in_person_locations_request_failure(
Expand Down