iotsensor fixed but session valid broken

This commit is contained in:
newtbot
2024-01-25 03:26:56 +08:00
parent 7403f66c8a
commit 057fbe2afb
19 changed files with 173 additions and 237 deletions

View File

@ -0,0 +1,20 @@
const moment = require("moment");
const currentTime = moment().format("YYYY-MM-DD HH:mm:ss");
//time is taken from the token
function isValid(time){
const timeDiff = moment(currentTime).diff(time, "minutes");
if (timeDiff > 1) {
console.log(timeDiff);
return false;
}
return true;
}
module.exports = { isValid };