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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e60887bb
Commit
e60887bb
authored
Nov 16, 2021
by
Kenneth Chu
Committed by
Matthias Käppler
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add link to troubleshooting steps in error message
parent
b11b5142
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
4 deletions
+22
-4
app/controllers/profiles/two_factor_auths_controller.rb
app/controllers/profiles/two_factor_auths_controller.rb
+1
-1
app/views/profiles/two_factor_auths/show.html.haml
app/views/profiles/two_factor_auths/show.html.haml
+3
-1
locale/gitlab.pot
locale/gitlab.pot
+4
-1
spec/controllers/profiles/two_factor_auths_controller_spec.rb
.../controllers/profiles/two_factor_auths_controller_spec.rb
+1
-1
spec/features/profiles/two_factor_auths_spec.rb
spec/features/profiles/two_factor_auths_spec.rb
+13
-0
No files found.
app/controllers/profiles/two_factor_auths_controller.rb
View file @
e60887bb
...
...
@@ -66,7 +66,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
render
'create'
else
@error
=
_
(
'Invalid pin code'
)
@error
=
{
message:
_
(
'Invalid pin code.'
)
}
@qr_code
=
build_qr_code
if
Feature
.
enabled?
(
:webauthn
)
...
...
app/views/profiles/two_factor_auths/show.html.haml
View file @
e60887bb
...
...
@@ -43,7 +43,9 @@
.gl-alert.gl-alert-danger.gl-mb-5
.gl-alert-container
.gl-alert-content
=
@error
%p
.gl-alert-body.gl-md-0
=
@error
[
:message
]
=
link_to
_
(
'Try the troubleshooting steps here.'
),
help_page_path
(
'user/profile/account/two_factor_authentication.md'
,
anchor:
'troubleshooting'
),
target:
'_blank'
,
rel:
'noopener noreferrer'
.form-group
=
label_tag
:pin_code
,
_
(
'Pin code'
),
class:
"label-bold"
=
text_field_tag
:pin_code
,
nil
,
class:
"form-control gl-form-input"
,
required:
true
,
data:
{
qa_selector:
'pin_code_field'
}
...
...
locale/gitlab.pot
View file @
e60887bb
...
...
@@ -18859,7 +18859,7 @@ msgstr ""
msgid "Invalid period"
msgstr ""
msgid "Invalid pin code"
msgid "Invalid pin code
.
"
msgstr ""
msgid "Invalid pod_name"
...
...
@@ -36651,6 +36651,9 @@ msgstr ""
msgid "Try out GitLab Pipelines"
msgstr ""
msgid "Try the troubleshooting steps here."
msgstr ""
msgid "Try to fork again"
msgstr ""
...
...
spec/controllers/profiles/two_factor_auths_controller_spec.rb
View file @
e60887bb
...
...
@@ -175,7 +175,7 @@ RSpec.describe Profiles::TwoFactorAuthsController do
it
'assigns error'
do
go
expect
(
assigns
[
:error
]).
to
eq
_
(
'Invalid pin code'
)
expect
(
assigns
[
:error
]).
to
eq
({
message:
'Invalid pin code.'
}
)
end
it
'assigns qr_code'
do
...
...
spec/features/profiles/two_factor_auths_spec.rb
View file @
e60887bb
...
...
@@ -45,6 +45,19 @@ RSpec.describe 'Two factor auths' do
expect
(
page
).
to
have_content
(
'Status: Enabled'
)
end
end
context
'when invalid pin is provided'
do
let_it_be
(
:user
)
{
create
(
:omniauth_user
)
}
it
'renders a error alert with a link to the troubleshooting section'
do
visit
profile_two_factor_auth_path
fill_in
'pin_code'
,
with:
'123'
click_button
'Register with two-factor app'
expect
(
page
).
to
have_link
(
'Try the troubleshooting steps here.'
,
href:
help_page_path
(
'user/profile/account/two_factor_authentication.md'
,
anchor:
'troubleshooting'
))
end
end
end
context
'when user has two-factor authentication enabled'
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