Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
a49c5d18
Commit
a49c5d18
authored
Mar 07, 2017
by
Markus Koller
Committed by
Alexis Reigel
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename skip_tfa session variable to skip_two_factor
parent
8e665140
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
app/controllers/concerns/enforces_two_factor_authentication.rb
...ontrollers/concerns/enforces_two_factor_authentication.rb
+1
-1
app/controllers/profiles/two_factor_auths_controller.rb
app/controllers/profiles/two_factor_auths_controller.rb
+1
-1
spec/controllers/application_controller_spec.rb
spec/controllers/application_controller_spec.rb
+1
-1
No files found.
app/controllers/concerns/enforces_two_factor_authentication.rb
View file @
a49c5d18
...
@@ -42,6 +42,6 @@ module EnforcesTwoFactorAuthentication
...
@@ -42,6 +42,6 @@ module EnforcesTwoFactorAuthentication
end
end
def
skip_two_factor?
def
skip_two_factor?
session
[
:skip_t
fa
]
&&
session
[
:skip_tfa
]
>
Time
.
current
session
[
:skip_t
wo_factor
]
&&
session
[
:skip_two_factor
]
>
Time
.
current
end
end
end
end
app/controllers/profiles/two_factor_auths_controller.rb
View file @
a49c5d18
...
@@ -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_t
fa
]
=
current_user
.
otp_grace_period_started_at
+
two_factor_grace_period
.
hours
session
[
:skip_t
wo_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
...
...
spec/controllers/application_controller_spec.rb
View file @
a49c5d18
...
@@ -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_t
fa
:
2
.
hours
.
from_now
})
allow
(
controller
).
to
receive
(
:session
).
and_return
({
skip_t
wo_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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment