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
6 changes: 3 additions & 3 deletions app/controllers/users/two_factor_authentication_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ class TwoFactorAuthenticationController < ApplicationController
before_action :check_remember_device_preference

def show
if current_user.totp_enabled?
if current_user.piv_cac_enabled?
redirect_to login_two_factor_piv_cac_url
elsif current_user.totp_enabled?
redirect_to login_two_factor_authenticator_url
elsif current_user.phone_enabled?
validate_otp_delivery_preference_and_send_code
elsif current_user.piv_cac_enabled?
redirect_to login_two_factor_piv_cac_url
else
redirect_to two_factor_options_url
end
Expand Down
5 changes: 0 additions & 5 deletions spec/features/two_factor_authentication/sign_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ def submit_prefilled_otp_code
user = user_with_piv_cac
sign_in_before_2fa(user)

click_link t('devise.two_factor_authentication.piv_cac_fallback.link')

expect(current_path).to eq login_two_factor_piv_cac_path

expect(page).not_to have_link(t('links.two_factor_authentication.app'))
Expand All @@ -465,8 +463,6 @@ def submit_prefilled_otp_code
user = create(:user, :signed_up, :with_piv_or_cac, otp_secret_key: 'foo')
sign_in_before_2fa(user)

click_link t('devise.two_factor_authentication.piv_cac_fallback.link')

expect(current_path).to eq login_two_factor_piv_cac_path

click_link t('links.two_factor_authentication.app')
Expand All @@ -477,7 +473,6 @@ def submit_prefilled_otp_code
scenario 'user can cancel PIV/CAC process' do
user = create(:user, :signed_up, :with_piv_or_cac)
sign_in_before_2fa(user)
click_link t('devise.two_factor_authentication.piv_cac_fallback.link')

expect(current_path).to eq login_two_factor_piv_cac_path
click_link t('links.cancel')
Expand Down