Project

General

Profile

Defect #34618 ยป 34618.patch

Go MAEDA, 2021-01-30 08:14

View differences:

app/controllers/my_controller.rb
self.main_menu = false
before_action :require_login
# let user change user's password when user has to
skip_before_action :check_password_change, :only => :password
skip_before_action :check_password_change, :check_twofa_activation, :only => :password
accept_api_auth :account
test/integration/twofa_test.rb
end
end
test 'should require to change password first when must_change_passwd is true' do
User.find_by(login: 'jsmith').update_attribute(:must_change_passwd, true)
with_settings twofa: '2' do
log_user('jsmith', 'jsmith')
follow_redirect!
assert_redirected_to '/my/password'
follow_redirect!
assert_response :success
end
end
test "should generate and accept backup codes" do
log_user('jsmith', 'jsmith')
get "/my/account"
    (1-1/1)