diff --git a/web-plugin/index.js b/web-plugin/index.js
index fb1d50a..ff01aa8 100644
--- a/web-plugin/index.js
+++ b/web-plugin/index.js
@@ -15,27 +15,28 @@ const ext = {
const auth_token = queryParams.get("auth_token");
const org_display = queryParams.get("org_display");
const origin = queryParams.get("origin");
+
+ const data = getData();
+ let endpoint = data.endpoint;
+ let apiKey = data.apiKey;
+
+ // If there is auth token override it
+ if (auth_token) {
+ apiKey = auth_token;
+ endpoint = origin;
+ saveData({
+ displayName: org_display,
+ endpoint: origin,
+ apiKey: auth_token,
+ displayName: org_display,
+ environment: "cloud",
+ });
+ localStorage.setItem("comfy_deploy_env", "cloud");
+ }
+
if (!workflow_version_id) {
console.error("No workflow_version_id provided in query parameters.");
} else {
- const data = getData();
- let endpoint = data.endpoint;
- let apiKey = data.apiKey;
-
- // If there is auth token override it
- if (auth_token) {
- apiKey = auth_token;
- endpoint = origin;
- saveData({
- displayName: org_display,
- endpoint: origin,
- apiKey: auth_token,
- displayName: org_display,
- environment: "cloud",
- });
- localStorage.setItem("comfy_deploy_env", "cloud");
- }
-
loadingDialog.showLoading(
"Loading workflow from " + org_display,
"Please wait...",
@@ -681,19 +682,16 @@ export class ConfigDialog extends ComfyDialog {