BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d0bab339
Unverified
Commit
d0bab339
authored
May 07, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only run session related Warden hooks for user scope
parent
5116b59f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
warden.rb
config/initializers/warden.rb
+5
-5
No files found.
config/initializers/warden.rb
View file @
d0bab339
Rails
.
application
.
configure
do
|
config
|
Warden
::
Manager
.
after_set_user
do
|
user
,
auth
,
opts
|
Warden
::
Manager
.
after_set_user
(
scope: :user
)
do
|
user
,
auth
,
opts
|
Gitlab
::
Auth
::
UniqueIpsLimiter
.
limit_user!
(
user
)
end
Warden
::
Manager
.
before_failure
do
|
env
,
opts
|
Warden
::
Manager
.
before_failure
(
scope: :user
)
do
|
env
,
opts
|
Gitlab
::
Auth
::
BlockedUserTracker
.
log_if_user_blocked
(
env
)
end
Warden
::
Manager
.
after_authentication
do
|
user
,
auth
,
opts
|
Warden
::
Manager
.
after_authentication
(
scope: :user
)
do
|
user
,
auth
,
opts
|
ActiveSession
.
cleanup
(
user
)
end
Warden
::
Manager
.
after_set_user
only: :fetch
do
|
user
,
auth
,
opts
|
Warden
::
Manager
.
after_set_user
(
scope: :user
,
only: :fetch
)
do
|
user
,
auth
,
opts
|
ActiveSession
.
set
(
user
,
auth
.
request
)
end
Warden
::
Manager
.
before_logout
do
|
user
,
auth
,
opts
|
Warden
::
Manager
.
before_logout
(
scope: :user
)
do
|
user
,
auth
,
opts
|
ActiveSession
.
destroy
(
user
||
auth
.
user
,
auth
.
request
.
session
.
id
)
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