diff --git a/test/accessToken.test.js b/test/accessToken.test.js index 1b6c52c3..62c51f1c 100644 --- a/test/accessToken.test.js +++ b/test/accessToken.test.js @@ -108,6 +108,9 @@ describe("access token update", function () { if (payload["tId"]) { expectedKeys.push("tId"); } + if (payload["rsub"]) { + expectedKeys.push("rsub"); + } assert.strictEqual(Object.keys(payload).length, expectedKeys.length); for (const key of Object.keys(payload)) { @@ -176,6 +179,9 @@ describe("access token update", function () { if (v3Payload["tId"]) { expectedKeys.push("tId"); } + if (v3Payload["rsub"]) { + expectedKeys.push("rsub"); + } assert.strictEqual(Object.keys(v3Payload).length, expectedKeys.length); for (const key of Object.keys(v3Payload)) { diff --git a/test/interception.basic1.test.js b/test/interception.basic1.test.js index 8bd733c8..1b7c8093 100644 --- a/test/interception.basic1.test.js +++ b/test/interception.basic1.test.js @@ -479,7 +479,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => { assert.strictEqual( Object.keys(data).length, - v3AccessTokenSupported ? (data["tId"] !== undefined ? 9 : 8) : 0 + v3AccessTokenSupported ? (data["rsub"] !== undefined ? 10 : data["tId"] !== undefined ? 9 : 8) : 0 ); // update jwt data diff --git a/test/server/index.js b/test/server/index.js index 6ef02244..b500105e 100644 --- a/test/server/index.js +++ b/test/server/index.js @@ -59,6 +59,7 @@ app.use(cookieParser()); let lastSetEnableAntiCSRF = false; let lastSetEnableJWT = false; +let accountLinkingSupported = maxVersion(supertokens_node_version, "15.0") === supertokens_node_version; function getConfig(enableAntiCsrf, enableJWT, jwtPropertyName) { if (enableJWT && maxVersion(supertokens_node_version, "14.0") === supertokens_node_version) { @@ -207,7 +208,12 @@ app.post("/login", async (req, res) => { let userId = req.body.userId; let session = MultiTenancyRecipeRaw !== undefined - ? await Session.createNewSession(req, res, "public", userId) + ? await Session.createNewSession( + req, + res, + "public", + accountLinkingSupported ? SuperTokens.convertToRecipeUserId(userId) : userId + ) : await Session.createNewSession(req, res, userId); res.send(session.getUserId()); }); diff --git a/test/server/package.json b/test/server/package.json index 4402021a..4d5b3cdb 100644 --- a/test/server/package.json +++ b/test/server/package.json @@ -12,6 +12,6 @@ "cookie-parser": "1.4.4", "cors": "^2.8.5", "express": "4.17.1", - "supertokens-node": "github:supertokens/supertokens-node#15.0" + "supertokens-node": "github:supertokens/supertokens-node#16.0" } }