Security improvements: Fix ownership checks, add password hashing with bcrypt

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-07 16:37:05 +00:00
co-authored by whyour
parent f355b4e441
commit b2b1777c6b
6 changed files with 88 additions and 34 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ const route = Router();
// Middleware to check if user is admin
const requireAdmin = (req: Request, res: Response, next: NextFunction) => {
if (req.user && (req.user as any).role === UserRole.admin) {
if (req.user && req.user.role === UserRole.admin) {
return next();
}
return res.status(403).send({ code: 403, message: '需要管理员权限' });