mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Merge pull request #5 from aaronpo97/aaronpo97-patch-1
This commit is contained in:
@@ -19,7 +19,7 @@ const getCurrentUser = async (
|
||||
}
|
||||
|
||||
req.user = user;
|
||||
next();
|
||||
await next();
|
||||
};
|
||||
|
||||
export default getCurrentUser;
|
||||
|
||||
@@ -15,7 +15,7 @@ export default nextConnect<
|
||||
NextApiResponse<z.infer<typeof APIResponseValidationSchema>>
|
||||
>(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);
|
||||
|
||||
Reference in New Issue
Block a user