Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ Performance/UriDefaultParser:
Enabled: true

Rails/ActionControllerFlashBeforeRender:
Enabled: false
Enabled: true

Rails/ActionControllerTestCase:
Enabled: true
Expand Down
9 changes: 6 additions & 3 deletions app/controllers/account_reset/cancel_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ def create
analytics.account_reset_cancel(**result.to_h)
irs_attempts_api_tracker.account_reset_cancel_request

handle_success if result.success?

redirect_to root_url
if result.success?
handle_success
else
redirect_to root_url
end
end

private
Expand All @@ -42,6 +44,7 @@ def handle_success
'two_factor_authentication.account_reset.successful_cancel',
app_name: APP_NAME,
)
redirect_to root_url
end

def token
Expand Down
1 change: 0 additions & 1 deletion app/controllers/concerns/idv_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def hybrid_session?
end

def confirm_phone_or_address_confirmed
return if flash[:allow_confirmations_continue]
return if idv_session.address_confirmed? || idv_session.phone_confirmed?

redirect_to idv_review_url
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/idv/personal_key_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ def finish_idv_session
idv_session.personal_key = nil

irs_attempts_api_tracker.idv_personal_key_generated

flash[:allow_confirmations_continue] = true
end

def personal_key
Expand Down
8 changes: 6 additions & 2 deletions app/controllers/users/totp_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ def confirm
end

def disable
process_successful_disable if MfaPolicy.new(current_user).multiple_factors_enabled?
redirect_to account_two_factor_authentication_path
if MfaPolicy.new(current_user).multiple_factors_enabled?
process_successful_disable
else
redirect_to account_two_factor_authentication_path
end
end

private
Expand Down Expand Up @@ -103,6 +106,7 @@ def process_successful_disable
revoke_remember_device(current_user)
revoke_otp_secret_key
flash[:success] = t('notices.totp_disabled')
redirect_to account_two_factor_authentication_path
end

def revoke_otp_secret_key
Expand Down
6 changes: 0 additions & 6 deletions spec/controllers/idv/personal_key_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ def index
)
end

it 'sets flash[:allow_confirmations_continue] to true' do
get :show

expect(flash[:allow_confirmations_continue]).to eq true
end

it 'logs when user generates personal key' do
expect(@irs_attempts_api_tracker).to receive(:idv_personal_key_generated)
get :show
Expand Down