Browse Source

Remove 2fa flash message (#694)

* Remove 2FA success flash message

* Rubocop
pull/647/head
baarkerlounger 3 years ago committed by GitHub
parent
commit
cf2f2b16bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/controllers/auth/two_factor_authentication_controller.rb
  2. 1
      spec/features/user_spec.rb

9
app/controllers/auth/two_factor_authentication_controller.rb

@ -23,6 +23,15 @@ private
end
end
def after_two_factor_success_for(resource)
set_remember_two_factor_cookie(resource)
warden.session(resource_name)[TwoFactorAuthentication::NEED_AUTHENTICATION] = false
bypass_sign_in(resource, scope: resource_name)
resource.update!(second_factor_attempts_count: 0)
redirect_to after_two_factor_success_path_for(resource)
end
def after_two_factor_success_path_for(resource)
if resource.is_a?(User) && resource.support?
"/organisations"

1
spec/features/user_spec.rb

@ -503,7 +503,6 @@ RSpec.describe "User Features" do
fill_in("code", with: otp)
click_button("Submit")
expect(page).to have_content("Logs")
expect(page).to have_content(I18n.t("devise.two_factor_authentication.success"))
end
context "but it is more than 15 minutes old" do

Loading…
Cancel
Save