testing auth

This commit is contained in:
kyle hoell
2020-12-08 06:47:24 -05:00
parent 9baa363a98
commit 09e930cf63
+7
View File
@@ -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;