Merge pull request #5 from aaronpo97/aaronpo97-patch-1

This commit is contained in:
Aaron Po
2023-02-09 13:08:02 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ const getCurrentUser = async (
} }
req.user = user; req.user = user;
next(); await next();
}; };
export default getCurrentUser; export default getCurrentUser;

View File

@@ -15,7 +15,7 @@ export default nextConnect<
NextApiResponse<z.infer<typeof APIResponseValidationSchema>> NextApiResponse<z.infer<typeof APIResponseValidationSchema>>
>(NextConnectConfig) >(NextConnectConfig)
.use(passport.initialize()) .use(passport.initialize())
.use(async (req, res, next) => { .use((req, res, next) => {
const parsed = LoginValidationSchema.safeParse(req.body); const parsed = LoginValidationSchema.safeParse(req.body);
if (!parsed.success) { if (!parsed.success) {
throw new ServerError('Username and password are required.', 400); throw new ServerError('Username and password are required.', 400);