From a221e6baccfe3f3c91cfad4b7cd95a70a9077f07 Mon Sep 17 00:00:00 2001 From: uku Date: Sat, 26 Oct 2024 12:44:11 +0200 Subject: [PATCH] fix: do not leak data in easy mode --- src/routes/game/+page.server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/game/+page.server.ts b/src/routes/game/+page.server.ts index ecd7593..7ba54da 100644 --- a/src/routes/game/+page.server.ts +++ b/src/routes/game/+page.server.ts @@ -37,6 +37,10 @@ export const load: PageServerLoad = async ({ fetch, url, platform }) => { } }); + const strippedStops = crossingStops.map((f) => { + return { ...f, properties: {} }; + }); + const randomStop = crossingStops[Math.floor(Math.random() * crossingStops.length)]; if (!randomStop) { @@ -46,7 +50,7 @@ export const load: PageServerLoad = async ({ fetch, url, platform }) => { const gameId = await createGame(randomStop, kv); const gameData: GameData = { lines: options.mode === "easy" || options.mode === "hard" ? lineColors : [], - stops: options.mode === "easy" ? crossingStops : [], + stops: options.mode === "easy" ? strippedStops : [], stopName: randomStop.properties!.nom, gameId, };