diff --git a/js/modules/loki_file_server_api.js b/js/modules/loki_file_server_api.js index 78c42f216..49fb47fe6 100644 --- a/js/modules/loki_file_server_api.js +++ b/js/modules/loki_file_server_api.js @@ -56,13 +56,17 @@ class LokiFileServerInstance { // FIXME: this is not file-server specific // and is currently called by LokiAppDotNetAPI. // LokiAppDotNetAPI (base) should not know about LokiFileServer. - async establishConnection(serverUrl) { + async establishConnection(serverUrl, options) { // why don't we extend this? this._server = new LokiAppDotNetAPI(this.ourKey, serverUrl); // configure proxy this._server.pubKey = this.pubKey; + if (options !== undefined && options.skipToken) { + return; + } + // get a token for multidevice const gotToken = await this._server.getOrRefreshServerToken(); // TODO: Handle this failure gracefully @@ -307,11 +311,13 @@ class LokiFileServerFactoryAPI { if (!thisServer) { thisServer = new LokiFileServerInstance(this.ourKey); log.info(`Registering FileServer ${serverUrl}`); - await thisServer.establishConnection(serverUrl); + await thisServer.establishConnection(serverUrl, { skipToken: true } ); this.servers.push(thisServer); } return thisServer; } } +// smuggle some data out of this joint (for expire.js/version upgrade check) +LokiFileServerFactoryAPI.secureRpcPubKey = LOKIFOUNDATION_FILESERVER_PUBKEY; module.exports = LokiFileServerFactoryAPI;