Only mark device as current if device got touched within last 30 minutes.
This commit is contained in:
parent
eb8144b28b
commit
08782ec52e
1 changed files with 2 additions and 1 deletions
|
@ -16,7 +16,8 @@ class UserDevicesController < ApplicationController
|
|||
attributes.delete('location_details')
|
||||
attributes.delete('fingerprint')
|
||||
|
||||
if session[:user_device_fingerprint] == device.fingerprint
|
||||
# mark current device to prevent killing own session via user preferences device management
|
||||
if session[:user_device_fingerprint] == device.fingerprint && device.updated_at > Time.zone.now - 30.minutes
|
||||
attributes['current'] = true
|
||||
end
|
||||
devices_full.push attributes
|
||||
|
|
Loading…
Reference in a new issue