Skip to content

Commit

Permalink
ensure private info not cached in world_map
Browse files Browse the repository at this point in the history
  • Loading branch information
timcowlishaw committed Mar 18, 2024
1 parent aa9aa43 commit c0eb0cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/v0/devices/_device.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local_assigns[:with_data] = true unless local_assigns.has_key?(:with_data)
local_assigns[:with_postprocessing] = true unless local_assigns.has_key?(:with_postprocessing)
local_assigns[:with_location] = true unless local_assigns.has_key?(:with_location)
local_assigns[:slim_owner] = false unless local_assigns.has_key?(:slim_owner)
local_assigns[:never_authorized] = false unless local_assigns.has_key?(:not_authorized)
local_assigns[:never_authorized] = false unless local_assigns.has_key?(:never_authorized)

json.(
device,
Expand All @@ -25,7 +25,7 @@ json.(
low_battery: device.notify_low_battery
})

authorized = !local_assigns[:never_authorized] && current_user && (current_user.is_admin? || (device.owner_id && current_user.id == device.owner_id))
authorized = !local_assigns[:never_authorized] && (current_user && (current_user.is_admin? || (device.owner_id && current_user.id == device.owner_id)))

if authorized
json.merge! device_token: device.device_token
Expand Down

0 comments on commit c0eb0cf

Please sign in to comment.