From 9bdcdf73c16d0ea628395a811e9ffe402e0fdc8e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 12 Jan 2017 09:15:01 +1300 Subject: [PATCH] User must be logged into Clara.io site to download --- scripts/system/html/js/marketplacesInject.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 2db250c52a..c5d463875f 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -132,6 +132,8 @@ // Automatic download to High Fidelity. function startAutoDownload() { + + // User must be able to write to Asset Server. if (!canWriteAssets) { console.log("ERROR: Clara.io FBX: File download cancelled because no permissions to write to Asset Server"); EventBridge.emitWebEvent(WARN_USER_NO_PERMISSIONS); @@ -139,6 +141,13 @@ return; } + // User must be logged in. + var loginButton = $("#topnav a[href='/signup']"); + if (loginButton.length > 0) { + loginButton[0].click(); + return; + } + // Obtain zip file to download for requested asset. // Reference: https://clara.io/learn/sdk/api/export var XMLHTTPREQUEST_URL = "https://clara.io/api/scenes/{uuid}/export/fbx?zip=true¢erScene=true&alignSceneGound=true&fbxUnit=Meter&fbxVersion=7&fbxEmbedTextures=true&imageFormat=WebGL";