Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-07 00:08:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-07 00:08:15 +0300
commitea3f6d2444fd63f0ccaa0707d0ccbc59ec9af040 (patch)
tree4dd5db5c3afcb1e30c9a65a048590a410ac8ac8d /config
parent1f5e09ed6082d079dfebef92f69630c10f78c844 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r--config/initializers/warden.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb
index 88f2a13df60..4aa5941747d 100644
--- a/config/initializers/warden.rb
+++ b/config/initializers/warden.rb
@@ -21,6 +21,8 @@ Rails.application.configure do |config|
Warden::Manager.after_authentication(scope: :user) do |user, auth, opts|
ActiveSession.cleanup(user)
+ # sets marketing cookie for active user session
+ ActiveSession.set_active_user_cookie(auth) if ::Gitlab.com?
Gitlab::AnonymousSession.new(auth.request.remote_ip).cleanup_session_per_ip_count
end
@@ -34,7 +36,8 @@ Rails.application.configure do |config|
Warden::Manager.before_logout(scope: :user) do |user, auth, opts|
user ||= auth.user
-
+ # deletes marketing cookie when user session ends
+ ActiveSession.unset_active_user_cookie(auth) if ::Gitlab.com?
# Rails CSRF protection may attempt to log out a user before that
# user even logs in
next unless user