Skip to content

Commit

Permalink
fix: await sessionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
peterphanouvong committed Oct 23, 2024
1 parent 0980df0 commit 0e947c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/session/getIdTokenRaw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
};
6 changes: 3 additions & 3 deletions src/session/isAuthenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {sessionManager} from './sessionManager';
* @returns {() => Promise<boolean>}
*/
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);

Expand Down

0 comments on commit 0e947c6

Please sign in to comment.