mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
respect do not track headers in trackable
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# and on authentication. Retrieving the user from session (:fetch) does
|
||||
# not trigger it.
|
||||
Warden::Manager.after_set_user :except => :fetch do |record, warden, options|
|
||||
if record.respond_to?(:update_tracked_fields!) && warden.authenticated?(options[:scope])
|
||||
if record.respond_to?(:update_tracked_fields!) && warden.authenticated?(options[:scope]) && warden.request.headers['X-Do-Not-Track'].to_s != '1' && warden.request.headers['DNT'].to_s != '1'
|
||||
record.update_tracked_fields!(warden.request)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user