tmp
This commit is contained in:
parent
b721bce67b
commit
4836de517c
1 changed files with 4 additions and 4 deletions
8
app.js
8
app.js
|
|
@ -14,11 +14,11 @@ import bcrypt from "bcrypt";
|
|||
const PORT = process.env.PORT || 3000;
|
||||
const __dirname = process.cwd();
|
||||
const ACTIVE_CODES = new Set();
|
||||
if (!fs.existsSync("./memory.txt")) {
|
||||
fs.writeFileSync("./memory.txt", "", "utf-8");
|
||||
if (!fs.existsSync("./tmp/memory.txt")) {
|
||||
fs.writeFileSync("./tmp/memory.txt", "", "utf-8");
|
||||
}
|
||||
let TOKENS = fs
|
||||
.readFileSync("./memory.txt", "utf-8")
|
||||
.readFileSync("./tmp/memory.txt", "utf-8")
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((token) => {
|
||||
|
|
@ -138,7 +138,7 @@ app.post("/validate-otp", (req, res) => {
|
|||
});
|
||||
|
||||
fs.writeFileSync(
|
||||
"./memory.txt",
|
||||
"./tmp/memory.txt",
|
||||
TOKENS.map((token) => {
|
||||
return `${token.id}:${token.token}:${token.expiration}`;
|
||||
}).join("\n"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue