Commit a49c5d18 authored by Markus Koller's avatar Markus Koller Committed by Alexis Reigel

Rename skip_tfa session variable to skip_two_factor

parent 8e665140
...@@ -42,6 +42,6 @@ module EnforcesTwoFactorAuthentication ...@@ -42,6 +42,6 @@ module EnforcesTwoFactorAuthentication
end end
def skip_two_factor? def skip_two_factor?
session[:skip_tfa] && session[:skip_tfa] > Time.current session[:skip_two_factor] && session[:skip_two_factor] > Time.current
end end
end end
...@@ -71,7 +71,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController ...@@ -71,7 +71,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
if two_factor_grace_period_expired? if two_factor_grace_period_expired?
redirect_to new_profile_two_factor_auth_path, alert: 'Cannot skip two factor authentication setup' redirect_to new_profile_two_factor_auth_path, alert: 'Cannot skip two factor authentication setup'
else else
session[:skip_tfa] = current_user.otp_grace_period_started_at + two_factor_grace_period.hours session[:skip_two_factor] = current_user.otp_grace_period_started_at + two_factor_grace_period.hours
redirect_to root_path redirect_to root_path
end end
end end
......
...@@ -295,7 +295,7 @@ describe ApplicationController do ...@@ -295,7 +295,7 @@ describe ApplicationController do
context 'with 2FA setup skipped' do context 'with 2FA setup skipped' do
before do before do
allow(controller).to receive(:session).and_return({ skip_tfa: 2.hours.from_now }) allow(controller).to receive(:session).and_return({ skip_two_factor: 2.hours.from_now })
end end
it 'returns false if the grace period has expired' do it 'returns false if the grace period has expired' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment