Commit beafa3f

mo <mo.khan@gmail.com>
2018-09-04 20:04:13
redirect to the mfa login page.
1 parent 2c4c0ad
Changed files (2)
app/controllers/application_controller.rb
@@ -33,6 +33,7 @@ class ApplicationController < ActionController::Base
 
   def authenticate_mfa!
     return unless current_user?
-    redirect_to mfa_path unless current_user.tfa.valid_session?(session[:mfa])
+    mfa = current_user.tfa
+    redirect_to new_mfa_path unless mfa.valid_session?(session[:mfa])
   end
 end
spec/requests/response_spec.rb
@@ -60,7 +60,7 @@ RSpec.describe "/response" do
 
         before { get '/response' }
 
-        specify { expect(response).to redirect_to(mfa_path) }
+        specify { expect(response).to redirect_to(new_mfa_path) }
       end
     end
   end