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 PORT = process.env.PORT || 3000;
|
||||||
const __dirname = process.cwd();
|
const __dirname = process.cwd();
|
||||||
const ACTIVE_CODES = new Set();
|
const ACTIVE_CODES = new Set();
|
||||||
if (!fs.existsSync("./memory.txt")) {
|
if (!fs.existsSync("./tmp/memory.txt")) {
|
||||||
fs.writeFileSync("./memory.txt", "", "utf-8");
|
fs.writeFileSync("./tmp/memory.txt", "", "utf-8");
|
||||||
}
|
}
|
||||||
let TOKENS = fs
|
let TOKENS = fs
|
||||||
.readFileSync("./memory.txt", "utf-8")
|
.readFileSync("./tmp/memory.txt", "utf-8")
|
||||||
.trim()
|
.trim()
|
||||||
.split("\n")
|
.split("\n")
|
||||||
.map((token) => {
|
.map((token) => {
|
||||||
|
|
@ -138,7 +138,7 @@ app.post("/validate-otp", (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"./memory.txt",
|
"./tmp/memory.txt",
|
||||||
TOKENS.map((token) => {
|
TOKENS.map((token) => {
|
||||||
return `${token.id}:${token.token}:${token.expiration}`;
|
return `${token.id}:${token.token}:${token.expiration}`;
|
||||||
}).join("\n"),
|
}).join("\n"),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue