From 7f208ed44e555818d867571b78fb6abb01ee1ac8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 21 Jan 2020 11:35:49 +0000 Subject: [PATCH] Allow a device key upload request without auth This is useful for querying the supported auth methods. --- src/base-apis.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base-apis.js b/src/base-apis.js index 576e32cdb..12434016f 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -1816,7 +1816,8 @@ MatrixBaseApis.prototype.getKeyChanges = function(oldToken, newToken) { }; MatrixBaseApis.prototype.uploadDeviceSigningKeys = function(auth, keys) { - const data = Object.assign({}, keys, {auth}); + const data = Object.assign({}, keys); + if (auth) Object.assign(data, {auth}); return this._http.authedRequest( undefined, "POST", "/keys/device_signing/upload", undefined, data, { prefix: PREFIX_UNSTABLE,