Skip to content

Conversation

@joelhawksley
Copy link
Contributor

This PR fixes:

DEPRECATION WARNING: ActionController::InvalidAuthenticityToken has been deprecated and will be removed in Rails 9.0. Use ActionController::InvalidCrossOriginRequest instead.

Integration

Changes are for tests only.

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.

Test-only.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: 7db2173

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a deprecation warning by replacing ActionController::InvalidAuthenticityToken with ActionController::InvalidCrossOriginRequest in preparation for Rails 9, where the former will be removed.

Changes:

  • Updated exception class from deprecated InvalidAuthenticityToken to InvalidCrossOriginRequest
  • Renamed handler method to match the new exception type
  • Added changeset for patch version bump

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
app/controllers/primer/view_components/toggle_switch_controller.rb Updated rescue_from handler to use new Rails exception class and renamed corresponding method
.changeset/few-seas-change.md Added changeset documenting the deprecation fix for patch release

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

🔥

@joelhawksley joelhawksley added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit f9fd6c8 Jan 30, 2026
38 checks passed
@joelhawksley joelhawksley deleted the rails-9-dep branch January 30, 2026 16:39
@primer primer bot mentioned this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants