No two factor authentication for development environment
@ -90,6 +90,8 @@ class User < ApplicationRecord
end
def need_two_factor_authentication?(_request)
return false if Rails.env.development?
support?
@ -140,6 +140,18 @@ RSpec.describe User, type: :model do
expect(user.case_logs_filters).to eq(%w[status years user organisation])
context "when the user is in development environment" do
let(:user) { FactoryBot.create(:user, :support) }
before do
allow(Rails.env).to receive(:development?).and_return(true)
it "does not require 2FA" do
expect(user.need_two_factor_authentication?(nil)).to be false
describe "paper trail" do