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
445d4cc0
Commit
445d4cc0
authored
Sep 21, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor password controller
parent
0f6c6b96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
app/controllers/passwords_controller.rb
app/controllers/passwords_controller.rb
+2
-12
ee/app/controllers/ee/passwords_controller.rb
ee/app/controllers/ee/passwords_controller.rb
+18
-0
No files found.
app/controllers/passwords_controller.rb
View file @
445d4cc0
...
...
@@ -2,7 +2,8 @@ class PasswordsController < Devise::PasswordsController
before_action
:resource_from_email
,
only:
[
:create
]
before_action
:prevent_ldap_reset
,
only:
[
:create
]
before_action
:throttle_reset
,
only:
[
:create
]
before_action
:log_audit_event
,
only:
[
:create
]
prepend
EE
::
PasswordsController
def
edit
super
...
...
@@ -54,15 +55,4 @@ class PasswordsController < Devise::PasswordsController
redirect_to
new_user_session_path
,
notice:
I18n
.
t
(
'devise.passwords.send_paranoid_instructions'
)
end
private
def
log_audit_event
AuditEventService
.
new
(
current_user
,
resource
,
action: :custom
,
custom_message:
'Ask for password reset'
,
ip_address:
request
.
remote_ip
)
.
for_user
(
resource_params
[
:email
]).
unauth_security_event
end
end
ee/app/controllers/ee/passwords_controller.rb
0 → 100644
View file @
445d4cc0
module
EE
module
PasswordsController
prepended
do
before_action
:log_audit_event
,
only:
[
:create
]
end
private
def
log_audit_event
AuditEventService
.
new
(
current_user
,
resource
,
action: :custom
,
custom_message:
'Ask for password reset'
,
ip_address:
request
.
remote_ip
)
.
for_user
(
resource_params
[
:email
]).
unauth_security_event
end
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