fix middleware using next() casues duplicate calls

This commit is contained in:
SrGooglo 2025-02-05 02:48:20 +00:00
parent c7f3cb9862
commit 613c940c69

View File

@ -1,4 +1,4 @@
export default async (req, res, next) => { export default async (req, res) => {
if (!req.auth) { if (!req.auth) {
return res.status(401).json({ error: "No authenticated" }) return res.status(401).json({ error: "No authenticated" })
} }
@ -9,5 +9,5 @@ export default async (req, res, next) => {
return res.status(403).json({ error: "To make this request it is necessary to have administrator permissions" }) return res.status(403).json({ error: "To make this request it is necessary to have administrator permissions" })
} }
next() return
} }