Break out of Turbo Frame on Devise 401 redirect

Changing the link is not an ideal solution because it doesn’t prevent this sequence of events:

  1. The user logs in.
  2. The form is rendered for the logged in user.
  3. The user’s session expires or they delete their session cookie.
  4. The user submits the form rendered in step 2. The server redirects to the new session page, and the Turbo Frame is replaced with empty content.