Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/login', (req, res) => {
- if(req.query.username == '' || req.query.password == ''){
- res.send('f');
- } else {
- var random = Math.floor(Math.random() * 100000) + 1;
- while (searchIntInArray(random, currentuids[1]) != -1){
- random = Math.floor(Math.random() * 100000) + 1;
- }
- if(searchStringInArray(req.query.username, currentuids[0]) == -1){
- currentuids[0].push(req.query.username);
- currentuids[1].push(random);
- temp = setTimeout(() => {
- deleteid(random)},
- 30000);
- currentuids[2].push(temp);
- } else {
- var temp = searchStringInArray(req.query.username, currentuids[0]);
- currentuids[1][temp] = random;
- clearTimeout(currentuids[2][temp]);
- currentuids[2][temp] = setTimeout(
- () => {deleteid(random)},
- 30000);
- }
- var randomtext = random.toString();
- var reponse = "t" + randomtext;
- res.send(reponse);
- console.log(timenow() + ": " + splitip(req.ip) + ' s\'est login. username: ' + req.query.username + " password: " + req.query.password + " réponse: " + reponse);
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement