Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
squi-ddy committed Oct 25, 2024
1 parent 0d6396a commit 0f7d2dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/api/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { UserTable, UserType } from "types/user"
import Archiver from "archiver"
import { objectsToCsv } from "utils"
import { getRandom } from "getRandom"
import { hash } from "passwords"

const router = Router()
router.use((req, res, next) => {
Expand Down Expand Up @@ -199,7 +200,7 @@ router.post("/addUser", async (req, res) => {
// add user
await sql`
INSERT INTO Users (uid, name, username, password, is_admin, is_booth, balance)
VALUES (${getRandom()}, ${name}, ${username}, ${password}, FALSE, TRUE, 0)
VALUES (${getRandom()}, ${name}, ${username}, ${await hash(password)}, FALSE, TRUE, 0)
`

res.json({ message: "User added" })
Expand Down

0 comments on commit 0f7d2dc

Please sign in to comment.