[41719] Fix 2FA using form_authenticity_token without ruby 3 kwargs

pull/10434/head
Oliver Günther 3 years ago
parent cbf91f69c4
commit e116c5f3eb
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 4
      app/cells/rails_cell.rb
  2. 10
      modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rb

@ -65,8 +65,8 @@ class RailsCell < Cell::ViewModel
context[:action_view] || controller.view_context
end
def form_authenticity_token(*args)
controller.send(:form_authenticity_token, *args)
def form_authenticity_token(**args)
controller.send(:form_authenticity_token, **args)
end
def protect_against_forgery?

@ -135,4 +135,14 @@ describe 'My Account 2FA configuration', with_2fa_ee: true,
expect(page).to have_selector('.on-off-status.-disabled')
expect(user.otp_devices.count).to eq 0
end
context 'when a device has been registered already' do
let!(:device) { create :two_factor_authentication_device_totp, user: user }
it 'loads the page correctly (Regression #41719)' do
visit my_2fa_devices_path
expect(page).to have_content device.identifier
end
end
end

Loading…
Cancel
Save