From 564d9c0583f59110dbee319c4fc19f48e5fefd66 Mon Sep 17 00:00:00 2001 From: Deepjyoti Barman Date: Fri, 4 Oct 2024 13:16:47 +0530 Subject: [PATCH] Add a comment about acceptin jwks as a parameter for getSessionForSSR --- lib/build/customFramework.js | 4 ++++ lib/ts/customFramework.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/build/customFramework.js b/lib/build/customFramework.js index e83316624..72515b298 100644 --- a/lib/build/customFramework.js +++ b/lib/build/customFramework.js @@ -174,6 +174,10 @@ exports.getSessionDetails = getSessionDetails; async function getSessionForSSR(request, jwks) { const accessToken = getAccessToken(request); const hasToken = !!accessToken; + // NOTE: We are accepting jwks as a parameter so that this function can + // be effectively tested. + // There's more details on why this is needed in the tests file where this + // function is being tested. let jwksToUse = jwks; if (!jwks) { const sessionRecipe = recipe_1.default.getInstanceOrThrowError(); diff --git a/lib/ts/customFramework.ts b/lib/ts/customFramework.ts index e32d840de..a51894568 100644 --- a/lib/ts/customFramework.ts +++ b/lib/ts/customFramework.ts @@ -207,6 +207,10 @@ export async function getSessionForSSR( const accessToken = getAccessToken(request); const hasToken = !!accessToken; + // NOTE: We are accepting jwks as a parameter so that this function can + // be effectively tested. + // There's more details on why this is needed in the tests file where this + // function is being tested. let jwksToUse = jwks; if (!jwks) { const sessionRecipe = SessionRecipe.getInstanceOrThrowError();