Update login.ts

This commit is contained in:
Aaron Po
2023-02-09 13:04:32 -05:00
committed by GitHub
parent bd68ecdec8
commit 363e371eb8

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);