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
Léo-Paul Géneau
gitlab-ce
Commits
66d9d258
Commit
66d9d258
authored
Sep 27, 2017
by
Brian Neel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Standardize capitalization and status
parent
d13349af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/controllers/concerns/authenticates_with_two_factor.rb
app/controllers/concerns/authenticates_with_two_factor.rb
+2
-2
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+2
-2
No files found.
app/controllers/concerns/authenticates_with_two_factor.rb
View file @
66d9d258
...
@@ -59,7 +59,7 @@ module AuthenticatesWithTwoFactor
...
@@ -59,7 +59,7 @@ module AuthenticatesWithTwoFactor
sign_in
(
user
)
sign_in
(
user
)
else
else
user
.
increment_failed_attempts!
user
.
increment_failed_attempts!
Gitlab
::
AppLogger
.
info
(
"Failed
l
ogin: user=
#{
user
.
username
}
ip=
#{
request
.
remote_ip
}
method=OTP"
)
Gitlab
::
AppLogger
.
info
(
"Failed
L
ogin: user=
#{
user
.
username
}
ip=
#{
request
.
remote_ip
}
method=OTP"
)
flash
.
now
[
:alert
]
=
'Invalid two-factor code.'
flash
.
now
[
:alert
]
=
'Invalid two-factor code.'
prompt_for_two_factor
(
user
)
prompt_for_two_factor
(
user
)
end
end
...
@@ -76,7 +76,7 @@ module AuthenticatesWithTwoFactor
...
@@ -76,7 +76,7 @@ module AuthenticatesWithTwoFactor
sign_in
(
user
)
sign_in
(
user
)
else
else
user
.
increment_failed_attempts!
user
.
increment_failed_attempts!
Gitlab
::
AppLogger
.
info
(
"Failed
l
ogin: user=
#{
user
.
username
}
ip=
#{
request
.
remote_ip
}
method=U2F"
)
Gitlab
::
AppLogger
.
info
(
"Failed
L
ogin: user=
#{
user
.
username
}
ip=
#{
request
.
remote_ip
}
method=U2F"
)
flash
.
now
[
:alert
]
=
'Authentication via U2F device failed.'
flash
.
now
[
:alert
]
=
'Authentication via U2F device failed.'
prompt_for_two_factor
(
user
)
prompt_for_two_factor
(
user
)
end
end
...
...
app/controllers/sessions_controller.rb
View file @
66d9d258
...
@@ -46,7 +46,7 @@ class SessionsController < Devise::SessionsController
...
@@ -46,7 +46,7 @@ class SessionsController < Devise::SessionsController
private
private
def
log_failed_login
def
log_failed_login
Gitlab
::
AppLogger
.
info
(
"Failed
l
ogin: username=
#{
user_params
[
:login
]
}
ip=
#{
request
.
remote_ip
}
"
)
if
failed_login?
Gitlab
::
AppLogger
.
info
(
"Failed
L
ogin: username=
#{
user_params
[
:login
]
}
ip=
#{
request
.
remote_ip
}
"
)
if
failed_login?
end
end
def
failed_login?
def
failed_login?
...
@@ -135,7 +135,7 @@ class SessionsController < Devise::SessionsController
...
@@ -135,7 +135,7 @@ class SessionsController < Devise::SessionsController
end
end
def
log_audit_event
(
user
,
resource
,
options
=
{})
def
log_audit_event
(
user
,
resource
,
options
=
{})
Gitlab
::
AppLogger
.
info
(
"
User l
ogin: username=
#{
resource
.
username
}
ip=
#{
request
.
remote_ip
}
method=
#{
options
[
:with
]
}
admin=
#{
resource
.
admin?
}
"
)
Gitlab
::
AppLogger
.
info
(
"
Successful L
ogin: username=
#{
resource
.
username
}
ip=
#{
request
.
remote_ip
}
method=
#{
options
[
:with
]
}
admin=
#{
resource
.
admin?
}
"
)
AuditEventService
.
new
(
user
,
user
,
options
)
AuditEventService
.
new
(
user
,
user
,
options
)
.
for_authentication
.
security_event
.
for_authentication
.
security_event
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