debut session
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details

Hugo PRADIER 10 months ago
commit 7e9aeee401

@ -8,7 +8,6 @@
"fmt": "dprint fmt" "fmt": "dprint fmt"
}, },
"devDependencies": { "devDependencies": {
"@types/bcryptjs": "^2.4.6",
"@types/bun": "^1.0.4", "@types/bun": "^1.0.4",
"dprint": "^0.46.2", "dprint": "^0.46.2",
"tsx": "^4.7.0", "tsx": "^4.7.0",
@ -23,9 +22,7 @@
"@fastify/type-provider-typebox": "^4.0.0", "@fastify/type-provider-typebox": "^4.0.0",
"@fastify/websocket": "^10.0.1", "@fastify/websocket": "^10.0.1",
"@sinclair/typebox": "^0.32.9", "@sinclair/typebox": "^0.32.9",
"@types/bcrypt": "^5.0.2",
"bcrypt": "^5.1.1", "bcrypt": "^5.1.1",
"bcryptjs": "^2.4.3",
"fastify": "^4.27.0", "fastify": "^4.27.0",
"nanoid": "^5.0.4", "nanoid": "^5.0.4",
"sqlite3": "^5.1.7", "sqlite3": "^5.1.7",

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

Loading…
Cancel
Save