From 539ec2ddd684ae38c439f0686ec7c3908125a354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mih=C3=A1ly=20Lengyel?= Date: Mon, 18 Mar 2024 13:52:27 +0100 Subject: [PATCH] test: update the test server to work with the next node version (#119) --- CHANGELOG.md | 2 ++ TestingApp/test/server/index.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16ebfa6..fa71c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] ## [4.1.1] - 2024-03-14 + - Support for new FDI version - 1.19 +- Update test server to work with new node server versions ## [4.1.0] - 2024-01-03 diff --git a/TestingApp/test/server/index.js b/TestingApp/test/server/index.js index 5f874e6..95ef6f4 100644 --- a/TestingApp/test/server/index.js +++ b/TestingApp/test/server/index.js @@ -49,6 +49,13 @@ try { multitenancySupported = false; } +let UserMetaDataRecipeRaw; +try { + UserMetaDataRecipeRaw = require("supertokens-node/lib/build/recipe/usermetadata/recipe").default; +} catch { + // Ignored +} + let generalErrorSupported; if (maxVersion(nodeSDKVersion, "10.0.0") === nodeSDKVersion) { @@ -283,6 +290,9 @@ app.post("/startST", async (req, res) => { MultitenancyRaw.reset(); } + if (UserMetaDataRecipeRaw !== undefined) { + UserMetaDataRecipeRaw.reset(); + } SuperTokens.init(getConfig(enableAntiCsrf, enableJWT)); } let pid = await startST();