From 7d6fdeaf517918ffa916347b3a2ea1d4655f4364 Mon Sep 17 00:00:00 2001 From: Kevin COMBRIAT Date: Mon, 4 Jul 2022 19:38:23 -0400 Subject: [PATCH] Web clients: Remove auth from clients for the moment --- crates/lgn-electron/electron/src/main.ts | 4 +- .../lgn-analytics-gui/src/electron/main.cjs | 4 +- .../src/routes/__layout.svelte | 20 ++-- .../src/components/ResourceBrowser.svelte | 32 ++++-- .../localChanges/LocalChanges.svelte | 10 +- .../propertyGrid/PropertyGrid.svelte | 2 +- .../resources/CreateResourceModal.svelte | 7 +- npm-pkgs/lgn-editor-gui/src/electron/main.cjs | 4 +- .../src/orchestrators/allActiveScenes.ts | 2 +- .../src/orchestrators/allResources.ts | 8 +- .../src/orchestrators/currentResource.ts | 4 +- .../src/orchestrators/selection.ts | 8 +- .../lgn-editor-gui/src/routes/__layout.svelte | 18 +-- .../lgn-editor-gui/src/routes/index.svelte | 10 +- npm-pkgs/lgn-editor-gui/src/stores/log.ts | 4 +- .../propertyGrid/PropertyGrid.test.ts | 2 +- .../__snapshots__/PropertyGrid.test.ts.snap | 2 +- npm-pkgs/lgn-runtime-gui/src/App.svelte | 7 +- .../lgn-runtime-gui/src/electron/main.cjs | 4 +- npm-pkgs/lgn-web-client/src/lib/auth/index.ts | 34 +++--- npm-pkgs/lgn-web-client/src/lib/client.ts | 106 ++++++++++-------- npm-pkgs/lgn-web-client/src/lib/errors.ts | 2 +- 22 files changed, 179 insertions(+), 115 deletions(-) diff --git a/crates/lgn-electron/electron/src/main.ts b/crates/lgn-electron/electron/src/main.ts index 7d23b35c2c..377dc85b68 100644 --- a/crates/lgn-electron/electron/src/main.ts +++ b/crates/lgn-electron/electron/src/main.ts @@ -51,7 +51,7 @@ function createWindow() { mainWindow.loadURL(configuration.source.value).catch((error) => { console.error( "electron::start", - `An error occured while loading the ${configuration.source.value} url: `, + `An error occurred while loading the ${configuration.source.value} url: `, error ); }); @@ -59,7 +59,7 @@ function createWindow() { loadUrl(mainWindow).catch((error) => { console.error( "electron::start", - `An error occured while loading the index.html file located under ${configuration.source.value}: `, + `An error occurred while loading the index.html file located under ${configuration.source.value}: `, error ); }); diff --git a/npm-pkgs/lgn-analytics-gui/src/electron/main.cjs b/npm-pkgs/lgn-analytics-gui/src/electron/main.cjs index 09125dc41d..716bb62057 100644 --- a/npm-pkgs/lgn-analytics-gui/src/electron/main.cjs +++ b/npm-pkgs/lgn-analytics-gui/src/electron/main.cjs @@ -44,7 +44,7 @@ const createWindow = () => { mainWindow.loadURL(devUrl).catch((error) => { console.error( "electron::start", - `An error occured while loading the ${devUrl} url: `, + `An error occurred while loading the ${devUrl} url: `, error ); }); @@ -52,7 +52,7 @@ const createWindow = () => { loadUrl(mainWindow).catch((error) => { console.error( "electron::start", - `An error occured while loading the index.html file located under ${indexHtmlDirPath}: `, + `An error occurred while loading the index.html file located under ${indexHtmlDirPath}: `, error ); }); diff --git a/npm-pkgs/lgn-analytics-gui/src/routes/__layout.svelte b/npm-pkgs/lgn-analytics-gui/src/routes/__layout.svelte index 928380fe4d..9964c1042e 100644 --- a/npm-pkgs/lgn-analytics-gui/src/routes/__layout.svelte +++ b/npm-pkgs/lgn-analytics-gui/src/routes/__layout.svelte @@ -179,7 +179,11 @@ // TODO: Here we can control the UI and display a modal or change the page content onMount(() => { if (initAuthStatus?.type === "error") { - window.location.href = initAuthStatus.authorizationUrl; + if (initAuthStatus.authorizationUrl) { + window.location.href = initAuthStatus.authorizationUrl; + } else { + log.warn("auth", "User is not authed"); + } } const unsubscribe = theme.subscribe(({ name }) => { @@ -194,16 +198,16 @@ }); -{#if initAuthStatus?.type !== "error"} - + + - + -
- -
-{/if} +
+ +
+