Login verification working.
This commit is contained in:
parent
d87307a370
commit
64e6548bda
@ -788,6 +788,21 @@ app.get(PREFIX+'/test/dataid',async(req,res)=>{
|
|||||||
res.status(200).json(finalresult)
|
res.status(200).json(finalresult)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.post(PREFIX+"/validUser",(req,res)=>{
|
||||||
|
console.log(process.env.SALT)
|
||||||
|
db.query('select * from users where username=$1 and password_hash=$2 limit 1',[req.body.username,req.body.password])
|
||||||
|
.then((data)=>{
|
||||||
|
if (data.rows.length>0) {
|
||||||
|
res.status(200).json({verified:true})
|
||||||
|
} else {
|
||||||
|
res.status(200).json({verified:false})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err)=>{
|
||||||
|
res.status(500).send(err.message)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
//Generates our table schema:
|
//Generates our table schema:
|
||||||
ENDPOINTDATA.forEach((endpoint)=>{
|
ENDPOINTDATA.forEach((endpoint)=>{
|
||||||
console.log(endpoint.endpoint+":\n\t"+endpoint.requiredfields.join('\t')+(endpoint.optionalfields.length>0?"\t":"")+endpoint.optionalfields.join("\t"))
|
console.log(endpoint.endpoint+":\n\t"+endpoint.requiredfields.join('\t')+(endpoint.optionalfields.length>0?"\t":"")+endpoint.optionalfields.join("\t"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user