From 674c5bdeb8ceca2b17a6157040da0752f5659c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 9 Mar 2022 11:22:33 +0100 Subject: [PATCH] Fxiing loading the Woka list --- front/src/Phaser/Login/CustomizeScene.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/front/src/Phaser/Login/CustomizeScene.ts b/front/src/Phaser/Login/CustomizeScene.ts index 3bd0c71d..9227d3e3 100644 --- a/front/src/Phaser/Login/CustomizeScene.ts +++ b/front/src/Phaser/Login/CustomizeScene.ts @@ -43,7 +43,19 @@ export class CustomizeScene extends AbstractCharacterScene { preload() { const wokaMetadataKey = "woka-list"; this.cache.json.remove(wokaMetadataKey); - this.load.json(wokaMetadataKey, `${PUSHER_URL}/woka/list`); + // FIXME: window.location.href is wrong. We need the URL of the main room (so we need to apply any redirect before!) + this.load.json( + wokaMetadataKey, + `${PUSHER_URL}/woka/list/` + encodeURIComponent(window.location.href), + undefined, + { + responseType: "text", + headers: { + Authorization: localUserStore.getAuthToken() ?? "", + }, + withCredentials: true, + } + ); this.load.once(`filecomplete-json-${wokaMetadataKey}`, () => { this.playerTextures.loadPlayerTexturesMetadata(this.cache.json.get(wokaMetadataKey)); this.loadCustomSceneSelectCharacters()