pull/6/head
Hugo PRADIER 10 months ago committed by clfreville2
parent f95011f3af
commit 7177638d99

@ -8,8 +8,8 @@
"fmt": "dprint fmt"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
"@types/bun": "^1.0.4",
"@types/bcrypt": "^5.0.2",
"dprint": "^0.46.2",
"tsx": "^4.7.0",
"typescript": "^5.3.3"
@ -24,9 +24,7 @@
"@fastify/websocket": "^10.0.1",
"@sinclair/typebox": "^0.32.9",
"dprint": "^0.46.1",
"@types/bcrypt": "^5.0.2",
"bcrypt": "^5.1.1",
"bcryptjs": "^2.4.3",
"fastify": "^4.27.0",
"nanoid": "^5.0.4",
"sqlite3": "^5.1.7",

@ -207,11 +207,13 @@ fastify.post(
const saltRounds = 10;
const hashedPassword = await bcrypt.hash(password, saltRounds);
if (!(await db.insertUser(database, login, hashedPassword, permissions))) {
reply.send({ success: false });
} else {
reply.send({ success: true });
}
const success = await db.insertUser(
database,
login,
hashedPassword,
permissions
);
reply.send({ success });
}
);

Loading…
Cancel
Save