This commit is contained in:
newtbot
2024-01-24 14:37:57 +08:00
parent e710fa15a1
commit d0aeab286a
5 changed files with 5 additions and 36 deletions

View File

@ -20,6 +20,8 @@ async function getUserID(userid) {
return userRes;
}
//register
//api/v0/auth/register
async function addUser(user) {
//hash password
let hashed = await hash(user.password);
@ -40,21 +42,6 @@ async function addUser(user) {
}
}
//getuser
//api/v0/user/me
async function getUserID(userid) {
//console.log(userid);
//console.log(userid.id);
let userRes = await userModel.findByPk(userid.id, {
attributes: {
exclude: ["password"],
},
});
if (!userRes) return false;
return userRes;
}
//api/v0/auth/register
/* Registering new user
1) req.body is taken from html form or wtv