Commit c793f4db authored by Jay Swain's avatar Jay Swain

Bugfix: avoid 500 when resending confirmation

The resource argument in the
`after_resending_confirmation_instructions_path_for` method is actuall a
symbol, not a user object. Avoiding calling methods on this argument
when redirecting to the almost_there path

part of:
https://gitlab.com/gitlab-org/gitlab/-/issues/333693#note_602683385

Changelog: fixed
parent 475ba0d9
......@@ -13,7 +13,7 @@ class ConfirmationsController < Devise::ConfirmationsController
protected
def after_resending_confirmation_instructions_path_for(resource)
return users_almost_there_path(email: resource.email) unless Feature.enabled?(:soft_email_confirmation)
return users_almost_there_path unless Feature.enabled?(:soft_email_confirmation)
stored_location_for(resource) || dashboard_projects_path
end
......
......@@ -128,6 +128,20 @@ RSpec.describe 'Login' do
end
end
end
context 'when resending the confirmation email' do
it 'redirects to the "almost there" page' do
stub_feature_flags(soft_email_confirmation: false)
user = create(:user)
visit new_user_confirmation_path
fill_in 'user_email', with: user.email
click_button 'Resend'
expect(current_path).to eq users_almost_there_path
end
end
end
describe 'with the ghost user' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment