diff --git a/backend/middleware/authRefresh.ts b/backend/middleware/authRefresh.ts index f45fc3c..8e2aa75 100644 --- a/backend/middleware/authRefresh.ts +++ b/backend/middleware/authRefresh.ts @@ -20,6 +20,8 @@ const removeOldTokens = async(userID: string, ipAddress: string | undefined, old try { + console.log("removing token with IP address", ipAddress); + const minusTime = oldTime - (1000 * 60 * 60); ipAddress = ipAddress ? ipAddress : ""; @@ -66,6 +68,11 @@ const authRefresh = async(req: RequestType, res: Response, next: NextFunction) = } } + if (!tokenFound) { + console.log("token not found", encryptedToken); + console.log("token list", user.tokens); + } + if (!tokenFound) throw new Error("Refresh Token Not Found"); req.user = user;