From bd68ecdec81733fade461c3f23b5c0a70ae6e279 Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Thu, 9 Feb 2023 13:03:24 -0500 Subject: [PATCH 1/2] Update getCurrentUser.ts awaiting next handler --- config/auth/middleware/getCurrentUser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/auth/middleware/getCurrentUser.ts b/config/auth/middleware/getCurrentUser.ts index 6fad42d..072a4a1 100644 --- a/config/auth/middleware/getCurrentUser.ts +++ b/config/auth/middleware/getCurrentUser.ts @@ -19,7 +19,7 @@ const getCurrentUser = async ( } req.user = user; - next(); + await next(); }; export default getCurrentUser; From 363e371eb8edd565086e57fea77add30e834c304 Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Thu, 9 Feb 2023 13:04:32 -0500 Subject: [PATCH 2/2] Update login.ts --- pages/api/users/login.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/users/login.ts b/pages/api/users/login.ts index ebf784e..29163a4 100644 --- a/pages/api/users/login.ts +++ b/pages/api/users/login.ts @@ -15,7 +15,7 @@ export default nextConnect< NextApiResponse> >(NextConnectConfig) .use(passport.initialize()) - .use(async (req, res, next) => { + .use((req, res, next) => { const parsed = LoginValidationSchema.safeParse(req.body); if (!parsed.success) { throw new ServerError('Username and password are required.', 400);