removed unneeded comments
This commit is contained in:
@@ -147,8 +147,6 @@ class FileController {
|
||||
|
||||
const id = req.params.id;
|
||||
const userID = req.user._id;
|
||||
|
||||
console.log("remove link", id);
|
||||
|
||||
await fileService.removeLink(userID, id)
|
||||
|
||||
@@ -547,8 +545,6 @@ class FileController {
|
||||
const fileID = req.body.id;
|
||||
const userID = req.user._id;
|
||||
const parentID = req.body.parent;
|
||||
|
||||
console.log(fileID, userID, parentID);
|
||||
|
||||
await fileService.moveFile(userID, fileID, parentID);
|
||||
|
||||
|
||||
@@ -82,14 +82,10 @@ class UserController {
|
||||
|
||||
try {
|
||||
|
||||
console.log("\nCreating New Refresh Token...")
|
||||
|
||||
const user = req.user;
|
||||
|
||||
if (!user) throw new NotFoundError("User Not Found");
|
||||
|
||||
console.log("tokens", user.tokens.length);
|
||||
|
||||
const {accessToken, refreshToken} = await user.generateAuthToken(req.clientIp);
|
||||
|
||||
if (!accessToken || !refreshToken) throw new InternalServerError("User/Access/Refresh Token Missing");
|
||||
@@ -98,8 +94,6 @@ class UserController {
|
||||
|
||||
res.status(201).send();
|
||||
|
||||
console.log("New Refresh Token And Access Token Sent");
|
||||
|
||||
} catch (e) {
|
||||
|
||||
console.log("\nGet Refresh Token User Route Error:", e.message);
|
||||
|
||||
@@ -7,8 +7,6 @@ const maxAgeStreamVideo = 60 * 1000 * 60 * 24;
|
||||
|
||||
const secureCookies = env.secureCookies ? env.secureCookies === "true" ? true : false : false;
|
||||
|
||||
console.log("Secure Cookies", secureCookies);
|
||||
|
||||
export const createLoginCookie = (res: Response, accessToken: string, refreshToken: string) => {
|
||||
|
||||
res.cookie("access-token",accessToken, {
|
||||
|
||||
@@ -56,8 +56,6 @@ class DbUtil {
|
||||
// query = {...query, "personalFolder": null}
|
||||
// }
|
||||
|
||||
console.log("folder query", query);
|
||||
|
||||
const folderList = await Folder.find(query)
|
||||
.sort(sortBy) as FolderInterface[];
|
||||
|
||||
@@ -71,7 +69,6 @@ class DbUtil {
|
||||
if (type) {
|
||||
if (type === "mongo") {
|
||||
query = {...query, "personalFolder": null}
|
||||
console.log("mongo query", query)
|
||||
} else {
|
||||
query = {...query, "personalFolder": true}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,6 @@ userSchema.statics.findByCreds = async(email: string, password: string) => {
|
||||
const isMatch = await bcrypt.compare(password, user.password);
|
||||
|
||||
if (!isMatch) {
|
||||
console.log("incorrect password")
|
||||
throw new Error("Incorrect password");
|
||||
}
|
||||
|
||||
@@ -596,7 +595,6 @@ userSchema.methods.decryptS3Data = async function() {
|
||||
|
||||
userSchema.methods.generatePasswordResetToken = async function() {
|
||||
|
||||
console.log("generating reset password token")
|
||||
const iv = crypto.randomBytes(16);
|
||||
|
||||
const user = this as UserInterface;
|
||||
|
||||
@@ -404,7 +404,6 @@ class FileSystemService implements ChunkInterface {
|
||||
await awaitStream(readStream.pipe(decipher), res, allStreamsToErrorCatch);
|
||||
|
||||
if (file.metadata.linkType === "one") {
|
||||
console.log("removing public link");
|
||||
await dbUtilsFile.removeOneTimePublicLink(fileID);
|
||||
}
|
||||
}
|
||||
@@ -468,8 +467,6 @@ class FileSystemService implements ChunkInterface {
|
||||
|
||||
deleteAll = async(userID: string) => {
|
||||
|
||||
console.log("remove all request")
|
||||
|
||||
await Folder.deleteMany({"owner": userID});
|
||||
|
||||
const fileList = await dbUtilsFile.getFileListByOwner(userID);
|
||||
|
||||
@@ -271,7 +271,6 @@ class MongoService implements ChunkInterface {
|
||||
await awaitStream(readStream.pipe(decipher), res, allStreamsToErrorCatch);
|
||||
|
||||
if (file.metadata.linkType === "one") {
|
||||
console.log("removing public link");
|
||||
await dbUtilsFile.removeOneTimePublicLink(fileID);
|
||||
}
|
||||
}
|
||||
@@ -454,8 +453,6 @@ class MongoService implements ChunkInterface {
|
||||
|
||||
deleteAll = async(userID: string) => {
|
||||
|
||||
console.log("remove all request")
|
||||
|
||||
let bucket = new mongoose.mongo.GridFSBucket(conn.db, {
|
||||
chunkSizeBytes: 1024 * 255
|
||||
});
|
||||
|
||||
@@ -203,8 +203,6 @@ class S3Service implements ChunkInterface {
|
||||
|
||||
const decipher = crypto.createDecipheriv('aes256', CIPHER_KEY, IV);
|
||||
|
||||
console.log("download personal file", currentFile.filename);
|
||||
|
||||
res.set('Content-Type', 'binary/octet-stream');
|
||||
res.set('Content-Disposition', 'attachment; filename="' + currentFile.filename + '"');
|
||||
res.set('Content-Length', currentFile.metadata.size.toString());
|
||||
@@ -466,7 +464,6 @@ class S3Service implements ChunkInterface {
|
||||
await awaitStream(readStream.pipe(decipher), res, allStreamsToErrorCatch);
|
||||
|
||||
if (file.metadata.linkType === "one") {
|
||||
console.log("removing public link");
|
||||
await dbUtilsFile.removeOneTimePublicLink(fileID);
|
||||
}
|
||||
}
|
||||
@@ -538,8 +535,6 @@ class S3Service implements ChunkInterface {
|
||||
|
||||
deleteAll = async(userID: string) => {
|
||||
|
||||
console.log("remove all request")
|
||||
|
||||
await Folder.deleteMany({"owner": userID});
|
||||
|
||||
const fileList = await dbUtilsFile.getFileListByOwner(userID);
|
||||
|
||||
@@ -171,8 +171,6 @@ class FolderService {
|
||||
|
||||
if (rootID === currentID) break;
|
||||
|
||||
console.log("finding ID", currentID)
|
||||
|
||||
const currentFolder = await this.getFolderInfo(userID, currentID);
|
||||
const currentSubFolders = await this.getFolderList(user, {parent: currentFolder._id});
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ class UserService {
|
||||
|
||||
if (currentEncryptedToken === encryptedToken) {
|
||||
|
||||
console.log("Refresh Token Found Logout!");
|
||||
user.tokens.splice(i, 1);
|
||||
await user.save();
|
||||
break;
|
||||
|
||||
@@ -64,9 +64,6 @@ const createQuery = (owner: string, parent: string, sortBy: string, startAt: num
|
||||
// query = {...query, "metadata.personalFile": true}
|
||||
// }
|
||||
|
||||
console.log("storage type", storageType)
|
||||
console.log("query", query);
|
||||
|
||||
return query;
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ const sendShareEmail = async (file: any, respient: string) => {
|
||||
}
|
||||
|
||||
await sgMail.send(msg);
|
||||
console.log("Share email sent");
|
||||
}
|
||||
|
||||
export default sendShareEmail
|
||||
@@ -19,8 +19,6 @@ type userAccessType = {
|
||||
|
||||
const userUpdateCheck = async(res: Response, id: string, ipAddress: string | undefined) => {
|
||||
|
||||
console.log("Loading full user for email verification check");
|
||||
|
||||
const updatedUser = await User.findById(id);
|
||||
|
||||
if (!updatedUser) throw new NotFoundError("Cannot find updated user auth");
|
||||
|
||||
Reference in New Issue
Block a user