cartodb-4.42/app/models/carto/helpers/sessions_invalidations.rb

14 lines
417 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
module Carto::SessionsInvalidations
def invalidate_all_sessions!
self.session_salt = SecureRandom.hex
if update_in_central
save!
else
log_error(message: "Could not invalidate session in Central")
end
rescue CartoDB::CentralCommunicationFailure, Sequel::ValidationFailed, ActiveRecord::RecordNotSaved => e
log_error(exception: e, message: "Could not invalidate session")
end
end