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
c2725384
Commit
c2725384
authored
May 07, 2021
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cr remarks
parent
fb43a606
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+8
-0
ee/app/controllers/ee/sessions_controller.rb
ee/app/controllers/ee/sessions_controller.rb
+0
-8
ee/spec/requests/git_http_spec.rb
ee/spec/requests/git_http_spec.rb
+1
-1
No files found.
app/controllers/sessions_controller.rb
View file @
c2725384
...
...
@@ -22,6 +22,7 @@ class SessionsController < Devise::SessionsController
prepend_before_action
:check_captcha
,
only:
[
:create
]
prepend_before_action
:store_redirect_uri
,
only:
[
:new
]
prepend_before_action
:require_no_authentication_without_flash
,
only:
[
:new
,
:create
]
prepend_before_action
:check_forbidden_password_based_login
,
if:
->
{
action_name
==
'create'
&&
password_based_login?
}
prepend_before_action
:ensure_password_authentication_enabled!
,
if:
->
{
action_name
==
'create'
&&
password_based_login?
}
before_action
:auto_sign_in_with_provider
,
only:
[
:new
]
...
...
@@ -313,6 +314,13 @@ class SessionsController < Devise::SessionsController
def
set_invite_params
@invite_email
=
ActionController
::
Base
.
helpers
.
sanitize
(
params
[
:invite_email
])
end
def
check_forbidden_password_based_login
if
find_user
&
.
password_based_login_forbidden?
flash
[
:alert
]
=
_
(
'You are not allowed to log in using password'
)
redirect_to
new_user_session_path
end
end
end
SessionsController
.
prepend_mod_with
(
'SessionsController'
)
ee/app/controllers/ee/sessions_controller.rb
View file @
c2725384
...
...
@@ -7,7 +7,6 @@ module EE
prepended
do
before_action
:gitlab_geo_logout
,
only:
[
:destroy
]
before_action
:check_forbidden_password_based_login
,
if:
->
{
action_name
==
'create'
&&
password_based_login?
}
end
override
:new
...
...
@@ -70,12 +69,5 @@ module EE
super
end
def
check_forbidden_password_based_login
if
find_user
&
.
password_based_login_forbidden?
flash
[
:alert
]
=
_
(
'You are not allowed to log in using password'
)
redirect_to
new_user_session_path
end
end
end
end
ee/spec/requests/git_http_spec.rb
View file @
c2725384
...
...
@@ -158,10 +158,10 @@ RSpec.describe 'Git HTTP requests' do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:private
,
group:
group
)
}
let_it_be
(
:user
)
{
create
(
:user
,
provisioned_by_group:
group
)
}
let
(
:env
)
{
{
user:
user
.
username
,
password:
user
.
password
}
}
let
(
:path
)
{
"
#{
project
.
full_path
}
.git"
}
before
do
project
.
add_developer
(
user
)
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