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
Boxiang Sun
gitlab-ce
Commits
7dac9624
Commit
7dac9624
authored
Sep 29, 2017
by
Brian Neel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove lock reason and add guard clause
parent
66d9d258
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+3
-1
app/models/user.rb
app/models/user.rb
+1
-1
No files found.
app/controllers/sessions_controller.rb
View file @
7dac9624
...
@@ -46,7 +46,9 @@ class SessionsController < Devise::SessionsController
...
@@ -46,7 +46,9 @@ class SessionsController < Devise::SessionsController
private
private
def
log_failed_login
def
log_failed_login
Gitlab
::
AppLogger
.
info
(
"Failed Login: username=
#{
user_params
[
:login
]
}
ip=
#{
request
.
remote_ip
}
"
)
if
failed_login?
return
unless
failed_login?
Gitlab
::
AppLogger
.
info
(
"Failed Login: username=
#{
user_params
[
:login
]
}
ip=
#{
request
.
remote_ip
}
"
)
end
end
def
failed_login?
def
failed_login?
...
...
app/models/user.rb
View file @
7dac9624
...
@@ -1063,7 +1063,7 @@ class User < ActiveRecord::Base
...
@@ -1063,7 +1063,7 @@ class User < ActiveRecord::Base
# override, from Devise
# override, from Devise
def
lock_access!
def
lock_access!
Gitlab
::
AppLogger
.
info
(
"Account Locked: username=
#{
username
}
reason=invalid_login_attempts
"
)
Gitlab
::
AppLogger
.
info
(
"Account Locked: username=
#{
username
}
"
)
super
super
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