Skip to content

Commit c78794c

Browse files
committed
fix: prevent mass-assignment of user field in apiCreateProject (#3876)
1 parent 95c1f38 commit c78794c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/controllers/project.controller/createProject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function createProject(req, res) {
2828

2929
// TODO: What happens if you don't supply any files?
3030
export async function apiCreateProject(req, res) {
31-
const params = Object.assign({ user: req.user._id }, req.body);
31+
const params = Object.assign({}, req.body, { user: req.user._id });
3232

3333
const sendValidationErrors = (err, type, code = 422) => {
3434
res.status(code).json({

0 commit comments

Comments
 (0)