diff --git a/services/fxaccounts/FxAccountsClient.jsm b/services/fxaccounts/FxAccountsClient.jsm index c5d9a599062a..c81a0cf404ac 100644 --- a/services/fxaccounts/FxAccountsClient.jsm +++ b/services/fxaccounts/FxAccountsClient.jsm @@ -33,6 +33,8 @@ const HOST_PREF = "identity.fxaccounts.auth.uri"; const SIGNIN = "/account/login"; const SIGNUP = "/account/create"; +// Devices older than this many days will not appear in the devices list +const DEVICES_FILTER_DAYS = 21; var FxAccountsClient = function(host = Services.prefs.getCharPref(HOST_PREF)) { this.host = host; @@ -705,7 +707,8 @@ FxAccountsClient.prototype = { }, /** - * Get a list of currently registered devices + * Get a list of currently registered devices that have been accessed + * in the last `DEVICES_FILTER_DAYS` days * * @method getDeviceList * @param sessionTokenHex @@ -724,9 +727,9 @@ FxAccountsClient.prototype = { * ] */ async getDeviceList(sessionTokenHex) { - let path = "/account/devices"; + let timestamp = Date.now() - 1000 * 60 * 60 * 24 * DEVICES_FILTER_DAYS; + let path = `/account/devices?filterIdleDevicesTimestamp=${timestamp}`; let creds = await deriveHawkCredentials(sessionTokenHex, "sessionToken"); - return this._request(path, "GET", creds, {}); },