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
8b44ac7e
Commit
8b44ac7e
authored
Apr 24, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
307ed2b5
240db73c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
12 deletions
+33
-12
app/controllers/concerns/authenticates_with_two_factor.rb
app/controllers/concerns/authenticates_with_two_factor.rb
+0
-7
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+12
-0
changelogs/unreleased/ce-remove-already-signed-in.yml
changelogs/unreleased/ce-remove-already-signed-in.yml
+5
-0
doc/development/contributing/issue_workflow.md
doc/development/contributing/issue_workflow.md
+3
-2
spec/features/users/login_spec.rb
spec/features/users/login_spec.rb
+13
-3
No files found.
app/controllers/concerns/authenticates_with_two_factor.rb
View file @
8b44ac7e
...
@@ -8,13 +8,6 @@
...
@@ -8,13 +8,6 @@
module
AuthenticatesWithTwoFactor
module
AuthenticatesWithTwoFactor
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
included
do
# This action comes from DeviseController, but because we call `sign_in`
# manually, not skipping this action would cause a "You are already signed
# in." error message to be shown upon successful login.
skip_before_action
:require_no_authentication
,
only:
[
:create
],
raise:
false
end
# Store the user's ID in the session for later retrieval and render the
# Store the user's ID in the session for later retrieval and render the
# two factor code prompt
# two factor code prompt
#
#
...
...
app/controllers/sessions_controller.rb
View file @
8b44ac7e
...
@@ -8,6 +8,8 @@ class SessionsController < Devise::SessionsController
...
@@ -8,6 +8,8 @@ class SessionsController < Devise::SessionsController
include
Recaptcha
::
Verify
include
Recaptcha
::
Verify
skip_before_action
:check_two_factor_requirement
,
only:
[
:destroy
]
skip_before_action
:check_two_factor_requirement
,
only:
[
:destroy
]
# replaced with :require_no_authentication_without_flash
skip_before_action
:require_no_authentication
,
only:
[
:new
,
:create
]
prepend_before_action
:check_initial_setup
,
only:
[
:new
]
prepend_before_action
:check_initial_setup
,
only:
[
:new
]
prepend_before_action
:authenticate_with_two_factor
,
prepend_before_action
:authenticate_with_two_factor
,
...
@@ -15,6 +17,8 @@ class SessionsController < Devise::SessionsController
...
@@ -15,6 +17,8 @@ class SessionsController < Devise::SessionsController
prepend_before_action
:check_captcha
,
only:
[
:create
]
prepend_before_action
:check_captcha
,
only:
[
:create
]
prepend_before_action
:store_redirect_uri
,
only:
[
:new
]
prepend_before_action
:store_redirect_uri
,
only:
[
:new
]
prepend_before_action
:ldap_servers
,
only:
[
:new
,
:create
]
prepend_before_action
:ldap_servers
,
only:
[
:new
,
:create
]
prepend_before_action
:require_no_authentication_without_flash
,
only:
[
:new
,
:create
]
before_action
:auto_sign_in_with_provider
,
only:
[
:new
]
before_action
:auto_sign_in_with_provider
,
only:
[
:new
]
before_action
:load_recaptcha
before_action
:load_recaptcha
...
@@ -54,6 +58,14 @@ class SessionsController < Devise::SessionsController
...
@@ -54,6 +58,14 @@ class SessionsController < Devise::SessionsController
private
private
def
require_no_authentication_without_flash
require_no_authentication
if
flash
[
:alert
]
==
I18n
.
t
(
'devise.failure.already_authenticated'
)
flash
[
:alert
]
=
nil
end
end
def
captcha_enabled?
def
captcha_enabled?
request
.
headers
[
CAPTCHA_HEADER
]
&&
Gitlab
::
Recaptcha
.
enabled?
request
.
headers
[
CAPTCHA_HEADER
]
&&
Gitlab
::
Recaptcha
.
enabled?
end
end
...
...
changelogs/unreleased/ce-remove-already-signed-in.yml
0 → 100644
View file @
8b44ac7e
---
title
:
Remove "You are already signed in" banner
merge_request
:
27377
author
:
type
:
other
doc/development/contributing/issue_workflow.md
View file @
8b44ac7e
...
@@ -340,13 +340,14 @@ addressed.
...
@@ -340,13 +340,14 @@ addressed.
In order to track things that can be improved in GitLab's codebase,
In order to track things that can be improved in GitLab's codebase,
we use the ~"technical debt" label in
[
GitLab's issue tracker
][
ce-tracker
]
.
we use the ~"technical debt" label in
[
GitLab's issue tracker
][
ce-tracker
]
.
For
user experience improv
ements, we use the ~"UX debt" label.
For
missed user experience requir
ements, we use the ~"UX debt" label.
These labels should be added to issues that describe things that can be improved,
These labels should be added to issues that describe things that can be improved,
shortcuts that have been taken, features that need additional attention, and all
shortcuts that have been taken, features that need additional attention, and all
other things that have been left behind due to high velocity of development.
other things that have been left behind due to high velocity of development.
For example, code that needs refactoring should use the ~"technical debt" label,
For example, code that needs refactoring should use the ~"technical debt" label,
user experience refinements should use the ~"UX debt" label.
something that didn't ship according to our Design System guidelines should
use the ~"UX debt" label.
Everyone can create an issue, though you may need to ask for adding a specific
Everyone can create an issue, though you may need to ask for adding a specific
label, if you do not have permissions to do it by yourself. Additional labels
label, if you do not have permissions to do it by yourself. Additional labels
...
...
spec/features/users/login_spec.rb
View file @
8b44ac7e
...
@@ -137,7 +137,7 @@ describe 'Login' do
...
@@ -137,7 +137,7 @@ describe 'Login' do
enter_code
(
user
.
current_otp
)
enter_code
(
user
.
current_otp
)
expect
(
page
).
not_to
have_content
(
'You are already signed in.'
)
expect
(
page
).
not_to
have_content
(
I18n
.
t
(
'devise.failure.already_authenticated'
)
)
end
end
context
'using one-time code'
do
context
'using one-time code'
do
...
@@ -317,7 +317,17 @@ describe 'Login' do
...
@@ -317,7 +317,17 @@ describe 'Login' do
gitlab_sign_in
(
user
)
gitlab_sign_in
(
user
)
expect
(
current_path
).
to
eq
root_path
expect
(
current_path
).
to
eq
root_path
expect
(
page
).
not_to
have_content
(
'You are already signed in.'
)
expect
(
page
).
not_to
have_content
(
I18n
.
t
(
'devise.failure.already_authenticated'
))
end
it
'does not show already signed in message when opening sign in page after login'
do
expect
(
authentication_metrics
)
.
to
increment
(
:user_authenticated_counter
)
gitlab_sign_in
(
user
)
visit
new_user_session_path
expect
(
page
).
not_to
have_content
(
I18n
.
t
(
'devise.failure.already_authenticated'
))
end
end
end
end
...
@@ -579,7 +589,7 @@ describe 'Login' do
...
@@ -579,7 +589,7 @@ describe 'Login' do
click_button
'Accept terms'
click_button
'Accept terms'
expect
(
current_path
).
to
eq
(
root_path
)
expect
(
current_path
).
to
eq
(
root_path
)
expect
(
page
).
not_to
have_content
(
'You are already signed in.'
)
expect
(
page
).
not_to
have_content
(
I18n
.
t
(
'devise.failure.already_authenticated'
)
)
end
end
it
'does not ask for terms when the user already accepted them'
do
it
'does not ask for terms when the user already accepted them'
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