Removing the two factor check when the user sets a new password

This commit is contained in:
Francisco Javier López 2018-03-01 16:28:15 +00:00 committed by Douwe Maan
parent c37cbb3125
commit 9e852340fb
3 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,6 @@
class Profiles::PasswordsController < Profiles::ApplicationController
skip_before_action :check_password_expiration, only: [:new, :create]
skip_before_action :check_two_factor_requirement, only: [:new, :create]
before_action :set_user
before_action :authorize_change_password!

View File

@ -0,0 +1,5 @@
---
title: Removing the two factor check when the user sets a new password
merge_request: 17457
author:
type: fixed

View File

@ -134,5 +134,15 @@ describe 'Profile > Password' do
expect(current_path).to eq new_user_session_path
end
context 'when global require_two_factor_authentication is enabled' do
it 'needs change user password' do
stub_application_setting(require_two_factor_authentication: true)
visit profile_path
expect(current_path).to eq new_profile_password_path
end
end
end
end