From 08838c989ecb464774a446739c5ee7410dc2a836 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Thu, 4 Apr 2024 17:44:34 -0400 Subject: [PATCH 1/2] Fix fragmented if..else seq (fix app tokens) --- src/helpers.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index 1b76ac9f..4d4f53cb 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -1955,23 +1955,20 @@ window.launch_app = async (options)=>{ iframe_url.searchParams.append('puter.domain', window.app_domain); } - // Add auth_token to GODMODE apps - if(app_info.godmode && app_info.godmode === 1){ + if (app_info.godmode && app_info.godmode === 1){ + // Add auth_token to GODMODE apps + iframe_url.searchParams.append('puter.auth.token', auth_token); iframe_url.searchParams.append('puter.auth.username', window.user.username); iframe_url.searchParams.append('puter.domain', window.app_domain); - } - // App token. Only add token if it's not a GODMODE app since GODMODE apps already have the super token - // that has access to everything. - else if(options.token){ + } else if (options.token){ + // App token. Only add token if it's not a GODMODE app since GODMODE apps already have the super token + // that has access to everything. + iframe_url.searchParams.append('puter.auth.token', options.token); - } + } else { + // Try to acquire app token from the server - if(api_origin) - iframe_url.searchParams.append('puter.api_origin', api_origin); - - // Try to acquire app token from the server - else{ let response = await fetch(window.api_origin + "/auth/get-user-app-token", { "headers": { "Content-Type": "application/json", @@ -1986,6 +1983,9 @@ window.launch_app = async (options)=>{ } } + if(api_origin) + iframe_url.searchParams.append('puter.api_origin', api_origin); + // Add options.params to URL if(options.params){ iframe_url.searchParams.append('puter.domain', window.app_domain); From be53a9472ad4a0170121af457217c36de811679d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Dub=C3=A9?= Date: Thu, 4 Apr 2024 18:39:53 -0400 Subject: [PATCH 2/2] Update docker-image.yaml --- .github/workflows/docker-image.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index f1dc1b40..ba1aa436 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -73,7 +73,6 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v5 with: - platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x context: . push: true tags: ${{ steps.meta.outputs.tags }}