fixed server error when not passing along a username or password
This commit is contained in:
parent
c05c5d47e0
commit
a11cc7380c
10
server.js
10
server.js
@ -531,6 +531,16 @@ router.post("/login",async function(req,res) {
|
|||||||
if(!increaseAPICall(req,res))return;
|
if(!increaseAPICall(req,res))return;
|
||||||
if(!increaseAPICall(req,res))return;
|
if(!increaseAPICall(req,res))return;
|
||||||
//login is counted twice (think of bruteforces man)
|
//login is counted twice (think of bruteforces man)
|
||||||
|
if(!req.body.user){
|
||||||
|
res.status(400)
|
||||||
|
res.send("no username given")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(!req.body.pass){
|
||||||
|
res.status(400)
|
||||||
|
res.send("no password given")
|
||||||
|
return
|
||||||
|
}
|
||||||
let username = req.body.user.toString()
|
let username = req.body.user.toString()
|
||||||
username = username.replace(" ","")
|
username = username.replace(" ","")
|
||||||
let password = req.body.pass.toString()
|
let password = req.body.pass.toString()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user