Fix session lookup.

This commit is contained in:
Mike Cao 2023-04-02 17:23:12 -07:00
parent bbdb672063
commit 9001361e4c
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ export const useSession = createMiddleware(async (req, res, next) => {
if (!session) { if (!session) {
log('useSession: Session not found'); log('useSession: Session not found');
return badRequest(res); return badRequest(res, 'Session not found.');
} }
(req as any).session = session; (req as any).session = session;

View File

@ -62,7 +62,7 @@ export async function findSession(req: NextApiRequestCollect) {
} }
// Find session // Find session
let session = await loadSession(websiteId); let session = await loadSession(sessionId);
// Create a session if not found // Create a session if not found
if (!session) { if (!session) {