From 95df29619753e64451f22909dcd2585e7b76edf9 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 25 Jul 2023 10:51:44 +0200 Subject: [PATCH] Fix broken boot sequence on HTTP without auth cookie --- web/client.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/client.ts b/web/client.ts index 8cda30c..6933072 100644 --- a/web/client.ts +++ b/web/client.ts @@ -205,6 +205,15 @@ export class Client { this.settings.indexPage, ); + // Pinging a remote space to ensure we're authenticated properly, if not will result in a redirect to auth page + try { + await this.remoteSpacePrimitives.getFileMeta("SETTINGS"); + } catch { + console.info( + "Could not reach remote server, either we're offline or not authenticated", + ); + } + await this.reloadPlugs(); this.pageNavigator.subscribe(async (pageName, pos: number | string) => { @@ -478,7 +487,6 @@ export class Client { } async reloadPlugs() { - console.log("Loading plugs"); await this.system.reloadPlugsFromSpace(this.space); this.rebuildEditorState(); await this.dispatchAppEvent("plugs:loaded");