Initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
|
||||
module.exports = {
|
||||
name:"validate",
|
||||
check: async function(apiKey){
|
||||
return new Promise(async (resolve,reject) => {
|
||||
if(apiKey == undefined){
|
||||
reject(1)
|
||||
}
|
||||
|
||||
let user = await commands.get("query").function("SELECT idUser from tbl_users WHERE dtApiKey = ?",[apiKey])
|
||||
if(user.length == 1){
|
||||
resolve(user[0].idUser)
|
||||
}else{
|
||||
// resolve(false)
|
||||
reject(2)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user