mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 13:30:00 -04:00
Merge pull request #104 from GreenyDEV/main
Fixes Cyclic Read only filesystem bug
This commit is contained in:
commit
3bc8f31a0b
2 changed files with 6 additions and 5 deletions
10
app.js
10
app.js
|
@ -10,15 +10,15 @@ import nodemailer from "nodemailer";
|
|||
import * as uuid from "uuid";
|
||||
import fs from "node:fs";
|
||||
import bcrypt from "bcrypt";
|
||||
|
||||
// fx
|
||||
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"),
|
||||
|
|
1
tmp/memory.txt
Normal file
1
tmp/memory.txt
Normal file
|
@ -0,0 +1 @@
|
|||
epic
|
Loading…
Add table
Add a link
Reference in a new issue