Skip to content

Commit

Permalink
LG-1344 Fix account reset for users with 1 MFA (ie no personal key) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegsa authored May 30, 2019
1 parent acf15c1 commit 229237f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/controllers/account_reset/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module AccountReset
class RequestController < ApplicationController
include TwoFactorAuthenticatable

before_action :confirm_multiple_factors_enabled
before_action :confirm_two_factor_enabled
before_action :confirm_user_not_verified

def show
Expand All @@ -18,8 +18,8 @@ def create

private

def confirm_multiple_factors_enabled
return if multiple_factors_enabled?
def confirm_two_factor_enabled
return if MfaPolicy.new(current_user).two_factor_enabled?

redirect_to two_factor_options_url
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/account_reset/request_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'rails_helper'

describe AccountReset::RequestController do
let(:user) { create(:user, :with_authentication_app, :with_backup_code, :with_email) }
let(:user) { create(:user, :with_authentication_app, :with_email) }
describe '#show' do
it 'renders the page' do
stub_sign_in_before_2fa(user)
Expand Down

0 comments on commit 229237f

Please sign in to comment.