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
Jérome Perrin
gitlab-ce
Commits
0f37721b
Commit
0f37721b
authored
Aug 11, 2016
by
Patricio Cano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2FA check is now done in the main GitHTTPClientController
parent
641d061e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
app/controllers/projects/git_http_client_controller.rb
app/controllers/projects/git_http_client_controller.rb
+7
-0
No files found.
app/controllers/projects/git_http_client_controller.rb
View file @
0f37721b
...
...
@@ -29,6 +29,7 @@ class Projects::GitHttpClientController < Projects::ApplicationController
# Not allowed
else
@user
=
auth_result
.
user
check_2fa
(
auth_result
.
type
)
end
if
ci?
||
user
...
...
@@ -91,6 +92,12 @@ class Projects::GitHttpClientController < Projects::ApplicationController
[
nil
,
nil
]
end
def
check_2fa
(
auth_type
)
if
user
&&
user
.
two_factor_enabled?
&&
auth_type
==
:gitlab_or_ldap
render
plain:
"HTTP Basic: Access denied
\n
You have 2FA enabled, please use a personal access token for Git over HTTP
\n
"
,
status:
401
end
end
def
repository
_
,
suffix
=
project_id_with_suffix
if
suffix
==
'.wiki.git'
...
...
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