mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +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;
|
req.user = user;
|
||||||
next();
|
await next();
|
||||||
};
|
};
|
||||||
|
|
||||||
export default getCurrentUser;
|
export default getCurrentUser;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user