Skip to content

Commit 17f8d6e

Browse files
jesse's changes for code optimization
Co-authored-by: Jesse Wright <63333554+jeswr@users.noreply.github.com>
1 parent b36734a commit 17f8d6e

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

api/server/services/SolidStorage.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,8 @@ async function getSolidFetchAndPodUrl(req) {
407407
throw new Error('User not authenticated with Solid/OpenID');
408408
}
409409

410-
const cached = req.session?.solidCachedPodUrlWebId === openidId && req.session?.solidCachedPodUrl;
411-
if (cached) {
412-
const authenticatedFetch = await getSolidFetch(req);
413-
logger.debug('[SolidStorage] Using cached Pod URL from session', { openidId });
414-
return { authenticatedFetch, podUrl: req.session.solidCachedPodUrl };
415-
}
416-
417410
const authenticatedFetch = await getSolidFetch(req);
418-
const podUrl = await getPodUrl(openidId, authenticatedFetch);
411+
const podUrl = req.session?.solidCachedPodUrl ?? await getPodUrl(openidId, authenticatedFetch);
419412
if (req.session) {
420413
req.session.solidCachedPodUrl = podUrl;
421414
req.session.solidCachedPodUrlWebId = openidId;

0 commit comments

Comments
 (0)