Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get("/withdraw", ensureAuthenticated, function(req, res){
- var token = req.get("Authorization")
- , decoded = jwt.verify(token, secret)
- , steamId = decoded.steamid;
- Mongo.query("withdraws", {"userId": steamId}, function(withdrawResult){
- if(withdrawResult.length > 0){
- var timestamp = new Date(withdrawResult[0]._created);
- var timestamp = new Date(timestamp.getTime() + 15*60000);
- var timestampObj = countTime(timestamp);
- console.log(timestampObj);
- if(timestampObj.minutes > 0){
- res.json({"successfull": false, "time": withdrawResult[0]._created});
- res.end();
- }else{
- res.json({"successfull": true});
- res.end();
- }
- }else{
- res.json({"successfull": true});
- res.end();
- }
- }, {"_created": -1});
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement