From 0e947c60ed399be4f731391fe8f955e5ee46a168 Mon Sep 17 00:00:00 2001 From: Peter Phanouvong Date: Wed, 23 Oct 2024 13:23:45 +1100 Subject: [PATCH] fix: await sessionManager --- src/session/getIdTokenRaw.js | 2 +- src/session/isAuthenticated.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/session/getIdTokenRaw.js b/src/session/getIdTokenRaw.js index cbc0600a..47a32030 100644 --- a/src/session/getIdTokenRaw.js +++ b/src/session/getIdTokenRaw.js @@ -14,5 +14,5 @@ import {sessionManager} from './sessionManager'; // @ts-ignore export const getIdTokenRawFactory = (req, res) => async () => { - return await sessionManager(req, res).getSessionItem('id_token'); + return await (await sessionManager(req, res)).getSessionItem('id_token'); }; diff --git a/src/session/isAuthenticated.js b/src/session/isAuthenticated.js index 7c8bbf6b..930896f8 100644 --- a/src/session/isAuthenticated.js +++ b/src/session/isAuthenticated.js @@ -9,9 +9,9 @@ import {sessionManager} from './sessionManager'; * @returns {() => Promise} */ export const isAuthenticatedFactory = (req, res) => async () => { - const accessToken = await sessionManager(req, res).getSessionItem( - 'access_token' - ); + const accessToken = await ( + await sessionManager(req, res) + ).getSessionItem('access_token'); const validToken = isTokenValid(accessToken);