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
iv
gitlab-ce
Commits
fcab1345
Commit
fcab1345
authored
Jan 23, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update wording for 2FA requirement notice
parent
5409fc49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
app/controllers/profiles/two_factor_auths_controller.rb
app/controllers/profiles/two_factor_auths_controller.rb
+2
-2
spec/features/login_spec.rb
spec/features/login_spec.rb
+5
-5
No files found.
app/controllers/profiles/two_factor_auths_controller.rb
View file @
fcab1345
...
@@ -13,10 +13,10 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
...
@@ -13,10 +13,10 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
current_user
.
save!
if
current_user
.
changed?
current_user
.
save!
if
current_user
.
changed?
if
two_factor_grace_period_expired?
if
two_factor_grace_period_expired?
flash
.
now
[
:alert
]
=
'You must
configure Two-Factor Authentication in
your account.'
flash
.
now
[
:alert
]
=
'You must
enable Two-factor Authentication for
your account.'
else
else
grace_period_deadline
=
current_user
.
otp_grace_period_started_at
+
two_factor_grace_period
.
hours
grace_period_deadline
=
current_user
.
otp_grace_period_started_at
+
two_factor_grace_period
.
hours
flash
.
now
[
:alert
]
=
"You must
configure Two-Factor Authentication in your account until
#{
l
(
grace_period_deadline
)
}
."
flash
.
now
[
:alert
]
=
"You must
enable Two-factor Authentication for your account before
#{
l
(
grace_period_deadline
)
}
."
end
end
@qr_code
=
build_qr_code
@qr_code
=
build_qr_code
...
...
spec/features/login_spec.rb
View file @
fcab1345
...
@@ -112,10 +112,10 @@ feature 'Login', feature: true do
...
@@ -112,10 +112,10 @@ feature 'Login', feature: true do
context
'within the grace period'
do
context
'within the grace period'
do
it
'redirects to two-factor configuration page'
do
it
'redirects to two-factor configuration page'
do
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
page
).
to
have_content
(
'You must
configure Two-Factor Authentication in your account until
'
)
expect
(
page
).
to
have_content
(
'You must
enable Two-factor Authentication for your account before
'
)
end
end
it
'
two-factor configuration is skippable
'
do
it
'
disallows skipping two-factor configuration
'
do
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
click_link
'Configure it later'
click_link
'Configure it later'
...
@@ -128,10 +128,10 @@ feature 'Login', feature: true do
...
@@ -128,10 +128,10 @@ feature 'Login', feature: true do
it
'redirects to two-factor configuration page'
do
it
'redirects to two-factor configuration page'
do
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
page
).
to
have_content
(
'You must
configure Two-Factor Authentication in
your account.'
)
expect
(
page
).
to
have_content
(
'You must
enable Two-factor Authentication for
your account.'
)
end
end
it
'
two-factor configuration is not skippable
'
do
it
'
disallows skipping two-factor configuration
'
do
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
page
).
not_to
have_link
(
'Configure it later'
)
expect
(
page
).
not_to
have_link
(
'Configure it later'
)
end
end
...
@@ -146,7 +146,7 @@ feature 'Login', feature: true do
...
@@ -146,7 +146,7 @@ feature 'Login', feature: true do
it
'redirects to two-factor configuration page'
do
it
'redirects to two-factor configuration page'
do
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
current_path
).
to
eq
new_profile_two_factor_auth_path
expect
(
page
).
to
have_content
(
'You must
configure Two-Factor Authentication in
your account.'
)
expect
(
page
).
to
have_content
(
'You must
enable Two-factor Authentication for
your account.'
)
end
end
end
end
end
end
...
...
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