feat: add current user to req

This commit is contained in:
Your Name 2026-08-06 14:36:21 -04:00
parent 48ac1249c8
commit 5299bd34ee
3 changed files with 447 additions and 0 deletions

5
db.js
View file

@ -55,6 +55,10 @@ function getUser(username) {
return db.prepare("SELECT * from users where username = ?").get(username);
}
function getUserById(id) {
return db.prepare("SELECT id, username FROM users WHERE id = ?").get(id);
}
// _ _ _______ ______ ___ _ _______ __ __ _______ _______
// | | _ | || || _ | | | | || || | | || || |
// | || || || _ || | || | |_| || _____|| |_| || _ || _ |
@ -714,6 +718,7 @@ module.exports = {
getDbInstance,
getAllRoutes,
getUser,
getUserById,
createUser,
getStructures,
getStructure,