Skip to content

Commit f9fd6c8

Browse files
authored
Fix deprecation warning for Rails 9 (#3898)
1 parent 1594ad6 commit f9fd6c8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/few-seas-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/view-components": patch
3+
---
4+
5+
Fix deprecation warning for Rails 9

app/controllers/primer/view_components/toggle_switch_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class << self
99
attr_accessor :last_request
1010
end
1111

12-
rescue_from ActionController::InvalidAuthenticityToken, with: :handle_invalid_authenticity_token
12+
rescue_from ActionController::InvalidCrossOriginRequest, with: :handle_invalid_cross_origin_request
1313

1414
before_action :reject_non_ajax_request
1515

@@ -29,7 +29,7 @@ def create
2929

3030
private
3131

32-
def handle_invalid_authenticity_token
32+
def handle_invalid_cross_origin_request
3333
render status: :unauthorized, plain: "Bad CSRF token."
3434
end
3535

0 commit comments

Comments
 (0)