From b02c09fc7bf794b31fb0b5288a9ec0b5a5647a76 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Wed, 24 Nov 2021 15:49:45 +0100 Subject: [PATCH 1/4] Clean token auth of url params Signed-off-by: Gregoire Parant --- front/src/Connexion/ConnectionManager.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/front/src/Connexion/ConnectionManager.ts b/front/src/Connexion/ConnectionManager.ts index ffd91d39..a8b172e6 100644 --- a/front/src/Connexion/ConnectionManager.ts +++ b/front/src/Connexion/ConnectionManager.ts @@ -84,7 +84,8 @@ class ConnectionManager { if (token) { this.authToken = token; localUserStore.setAuthToken(token); - //token was saved, clear url + + //clean token of url urlParams.delete("token"); } @@ -95,8 +96,6 @@ class ConnectionManager { } urlManager.pushRoomIdToUrl(this._currentRoom); } else if (connexionType === GameConnexionTypes.jwt) { - const urlParams = new URLSearchParams(window.location.search); - if (!token) { const code = urlParams.get("code"); const state = urlParams.get("state"); @@ -139,7 +138,7 @@ class ConnectionManager { "//" + window.location.host + roomUrl + - window.location.search + + urlParams.toString() + //use urlParams because the token param must be deleted window.location.hash ) ); @@ -169,7 +168,7 @@ class ConnectionManager { "//" + window.location.host + window.location.pathname + - window.location.search + + urlParams.toString() + //use urlParams because the token param must be deleted window.location.hash; } @@ -218,8 +217,6 @@ class ConnectionManager { analyticsClient.identifyUser(this.localUser.uuid, this.localUser.email); } - //clean history with new URL - window.history.pushState({}, document.title, window.location.pathname); this.serviceWorker = new _ServiceWorker(); return Promise.resolve(this._currentRoom); } From 065404758b7b3920bad1c42417cae564b979e0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 24 Nov 2021 16:22:26 +0100 Subject: [PATCH 2/4] Making sure pusher and admin are started in CI --- .github/workflows/end_to_end_tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/end_to_end_tests.yml b/.github/workflows/end_to_end_tests.yml index 4360d5e1..e931f6c7 100644 --- a/.github/workflows/end_to_end_tests.yml +++ b/.github/workflows/end_to_end_tests.yml @@ -32,6 +32,12 @@ jobs: - name: "Wait for environment to build (and downloading testcafe image)" run: (docker-compose -f docker-compose.testcafe.yml pull &) && docker-compose logs -f --tail=0 front | grep -m 1 "Compiled successfully" + - name: "Wait for back start" + run: docker-compose logs -f back | grep -m 1 "WorkAdventure HTTP API starting on port" + + - name: "Wait for pusher start" + run: docker-compose logs -f pusher | grep -m 1 "WorkAdventure starting on port" + - name: "Run tests" run: docker-compose -f docker-compose.testcafe.yml up --exit-code-from testcafe From d8c10ce10a63dfc7dc07f1622deb53638144c0a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 24 Nov 2021 16:32:37 +0100 Subject: [PATCH 3/4] CI fix --- .github/workflows/end_to_end_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/end_to_end_tests.yml b/.github/workflows/end_to_end_tests.yml index e931f6c7..8f0e679f 100644 --- a/.github/workflows/end_to_end_tests.yml +++ b/.github/workflows/end_to_end_tests.yml @@ -32,6 +32,9 @@ jobs: - name: "Wait for environment to build (and downloading testcafe image)" run: (docker-compose -f docker-compose.testcafe.yml pull &) && docker-compose logs -f --tail=0 front | grep -m 1 "Compiled successfully" + - name: "temp debug: display logs" + run: docker-compose logs + - name: "Wait for back start" run: docker-compose logs -f back | grep -m 1 "WorkAdventure HTTP API starting on port" From d1122d75ecf6998c71b5560c57c5c9ff9961191b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 24 Nov 2021 16:59:22 +0100 Subject: [PATCH 4/4] Fixing CI --- .github/workflows/end_to_end_tests.yml | 6 +++--- back/src/Services/Logger.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/end_to_end_tests.yml b/.github/workflows/end_to_end_tests.yml index 8f0e679f..bd9a7f47 100644 --- a/.github/workflows/end_to_end_tests.yml +++ b/.github/workflows/end_to_end_tests.yml @@ -30,16 +30,16 @@ jobs: run: docker-compose up -d - name: "Wait for environment to build (and downloading testcafe image)" - run: (docker-compose -f docker-compose.testcafe.yml pull &) && docker-compose logs -f --tail=0 front | grep -m 1 "Compiled successfully" + run: (docker-compose -f docker-compose.testcafe.yml pull &) && docker-compose logs -f --tail=0 front | grep -q "Compiled successfully" - name: "temp debug: display logs" run: docker-compose logs - name: "Wait for back start" - run: docker-compose logs -f back | grep -m 1 "WorkAdventure HTTP API starting on port" + run: docker-compose logs -f back | grep -q "WorkAdventure HTTP API starting on port" - name: "Wait for pusher start" - run: docker-compose logs -f pusher | grep -m 1 "WorkAdventure starting on port" + run: docker-compose logs -f pusher | grep -q "WorkAdventure starting on port" - name: "Run tests" run: docker-compose -f docker-compose.testcafe.yml up --exit-code-from testcafe diff --git a/back/src/Services/Logger.ts b/back/src/Services/Logger.ts index e19f60d1..79f81472 100644 --- a/back/src/Services/Logger.ts +++ b/back/src/Services/Logger.ts @@ -4,7 +4,7 @@ const logger = winston.createLogger({ transports: [ new winston.transports.Console({ format: winston.format.combine( - winston.format.colorize(), + //winston.format.colorize(), winston.format.timestamp(), winston.format.align(), winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`)