changed mongoose version and added types, removed console log from refresh, and added some comments
This commit is contained in:
@@ -20,8 +20,6 @@ const removeOldTokens = async(userID: string, uuid: string | undefined, oldTime:
|
||||
|
||||
try {
|
||||
|
||||
console.log("removing token with uuid address", uuid);
|
||||
|
||||
const minusTime = oldTime - (1000 * 60 * 60);
|
||||
//const minusTime = oldTime - (1000);
|
||||
|
||||
|
||||
+4
-1
@@ -52,6 +52,7 @@
|
||||
"@types/helmet": "0.0.45",
|
||||
"@types/jsonwebtoken": "^8.3.9",
|
||||
"@types/mongodb": "^3.5.5",
|
||||
"@types/mongoose": "^5.10.3",
|
||||
"@types/node": "^13.13.13",
|
||||
"@types/redis": "^2.8.26",
|
||||
"@types/request": "^2.48.5",
|
||||
@@ -82,12 +83,14 @@
|
||||
"googleapis": "^52.1.0",
|
||||
"helmet": "^3.21.2",
|
||||
"history": "^4.10.1",
|
||||
"i": "^0.3.6",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"mini-css-extract-plugin": "^0.8.2",
|
||||
"moment": "^2.24.0",
|
||||
"mongodb": "^3.5.3",
|
||||
"mongoose": "^5.9.1",
|
||||
"mongoose": "~5.10.11",
|
||||
"normalize.css": "^8.0.1",
|
||||
"npm": "^7.3.0",
|
||||
"password-prompt": "^1.1.2",
|
||||
"progress-stream": "^2.0.0",
|
||||
"prompts": "^2.3.1",
|
||||
|
||||
@@ -17,19 +17,13 @@ const axios3 = axios.create();
|
||||
|
||||
axiosRetry.interceptors.request.use((config) => {
|
||||
|
||||
console.time("uuid-test")
|
||||
|
||||
if (!browserIDCheck) {
|
||||
console.log("creating new UUID")
|
||||
browserIDCheck = uuid.v4();
|
||||
localStorage.setItem("browser-id", browserIDCheck);
|
||||
};
|
||||
|
||||
console.log("request interceptor")
|
||||
config.headers.uuid = browserIDCheck;
|
||||
|
||||
console.timeEnd("uuid-test")
|
||||
|
||||
return config;
|
||||
|
||||
}, (error) => {
|
||||
@@ -65,7 +59,6 @@ axiosRetry.interceptors.response.use((response) => {
|
||||
}
|
||||
|
||||
if (!browserIDCheck) {
|
||||
console.log("creating new UUID")
|
||||
browserIDCheck = uuid.v4();
|
||||
localStorage.setItem("browser-id", browserIDCheck);
|
||||
};
|
||||
@@ -74,6 +67,10 @@ axiosRetry.interceptors.response.use((response) => {
|
||||
"uuid" : browserIDCheck
|
||||
}}).then((cookieResponse) => {
|
||||
|
||||
// We need to sleep before requesting again, if not I believe
|
||||
// The old request will still be open and it will not make a
|
||||
// Brand new request sometimes, so it will log users out
|
||||
// But adding a sleep function seems to fix this.
|
||||
return sleep("sleepy boi");
|
||||
|
||||
}).then((sleepres) => {
|
||||
|
||||
Reference in New Issue
Block a user