From ed279098bed793cdb66f5c408e1ddcaeac434835 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Thu, 29 Oct 2026 22:09:05 -0700 Subject: [PATCH] Render the React page for the password reset link PasswordsController overrode `new` to hand off to the React app, but not `edit`, so the link in the reset email fell through to Devise's stock view (there's no app/views/devise/passwords). Users got an unstyled form instead of the ResetPassword page. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01UKBUsvK2TxyNpBVBi531xz --- app/controllers/passwords_controller.rb | 4 ++++ test/controllers/passwords_controller_test.rb | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/controllers/passwords_controller_test.rb diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 9772e320a5c..9fa25fe71a8 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -4,6 +4,10 @@ def new render html: "", layout: "application" end + def edit + render html: "", layout: "application" + end + def create self.resource = resource_class.find_or_initialize_with_errors(resource_class.reset_password_keys, resource_params, :not_found) diff --git a/test/controllers/passwords_controller_test.rb b/test/controllers/passwords_controller_test.rb new file mode 100644 index 00000000000..669628ba597 --- /dev/null +++ b/test/controllers/passwords_controller_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +require "test_helper" + +class PasswordsControllerTest < ActionDispatch::IntegrationTest + it "serves the app shell for the forgot password page" do + create(:root_site) + + get new_user_password_path + + assert_response :success + assert_select "form", false + end + + it "serves the app shell for the reset password page instead of Devise's default form" do + create(:root_site) + + get edit_user_password_path(reset_password_token: "sometoken") + + assert_response :success + assert_select "form", false + end +end