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");
|
||||
|
||||
@@ -35,8 +35,6 @@ export const startLogin = (email, password, currentRoute) => {
|
||||
|
||||
//window.localStorage.setItem("token", token);
|
||||
|
||||
console.log("USER SERVICE LOGIN RESPONSE", response.data.user);
|
||||
|
||||
if (emailVerified) {
|
||||
|
||||
dispatch(setLoginFailed(false))
|
||||
@@ -115,8 +113,6 @@ export const startLoginCheck = (currentRoute) => {
|
||||
return (dispatch) => {
|
||||
|
||||
axios.get("/user-service/user").then((response) => {
|
||||
|
||||
console.log("USER SERVICE LOGIN CHECK RESPONSE", response.data);
|
||||
|
||||
const emailVerified = response.data.emailVerified;
|
||||
|
||||
|
||||
@@ -67,8 +67,6 @@ export const startSetFileAndFolderItems = (historyKey, parent="/", sortby="DEFAU
|
||||
if (search && search !== "") {
|
||||
|
||||
//fileURL =
|
||||
console.log("Searching");
|
||||
|
||||
// if (storageType === "stripe") {
|
||||
|
||||
// console.log("Pied Search")
|
||||
@@ -190,8 +188,6 @@ export const startSetAllItems = (clearCache, parent="/", sortby="DEFAULT", searc
|
||||
|
||||
const quickItemsURL = !env.googleDriveEnabled ? `/file-service/quick-list` : `/file-service-google-mongo/quick-list`;
|
||||
|
||||
console.log("google drive enabled", env.googleDriveEnabled);
|
||||
|
||||
dispatch(setFiles([]))
|
||||
dispatch(setFolders([]))
|
||||
dispatch(setQuickFiles([]))
|
||||
@@ -235,12 +231,8 @@ export const startSetFiles = (parent="/", sortby="DEFAULT", search="", isGoogle=
|
||||
dispatch(setFiles([]))
|
||||
dispatch(setLoading(true))
|
||||
|
||||
console.log("Fetching file list");
|
||||
|
||||
if (env.googleDriveEnabled) {
|
||||
|
||||
console.log("is google")
|
||||
|
||||
axios.get(`/file-service-google/list?parent=${parent}&sortby=${sortby}&search=${search}&limit=${limit}&storageType=${storageType}`).then((results) => {
|
||||
|
||||
const googleList = results.data;
|
||||
@@ -259,8 +251,6 @@ export const startSetFiles = (parent="/", sortby="DEFAULT", search="", isGoogle=
|
||||
})
|
||||
} else if (env.googleDriveEnabled && parent === "/") {
|
||||
|
||||
console.log("is not google")
|
||||
|
||||
// Temp Google Drive API
|
||||
axios.get(`/file-service-google-mongo/list?parent=${parent}&sortby=${sortby}&search=${search}&limit=${limit}&storageType=${storageType}`).then((results) => {
|
||||
// console.log("Google Data", results.data.data.files);
|
||||
@@ -283,9 +273,6 @@ export const startSetFiles = (parent="/", sortby="DEFAULT", search="", isGoogle=
|
||||
})
|
||||
} else {
|
||||
|
||||
console.log("is not google")
|
||||
|
||||
|
||||
axios.get(`/file-service/list?parent=${parent}&sortby=${sortby}&search=${search}&limit=${limit}&storageType=${storageType}`).then((results) => {
|
||||
|
||||
const mongoData = results.data;
|
||||
@@ -316,10 +303,6 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star
|
||||
|
||||
return (dispatch) => {
|
||||
|
||||
console.log("search", search)
|
||||
|
||||
//dispatch(setLoading(true))
|
||||
|
||||
dispatch(setLoadingMoreItems(true));
|
||||
|
||||
let limit = window.localStorage.getItem("list-size") || 50
|
||||
@@ -327,8 +310,6 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star
|
||||
|
||||
if (isGoogle) {
|
||||
|
||||
console.log("is google")
|
||||
|
||||
// Temp Google Drive API
|
||||
axios.get(`/file-service-google/list?limit=${limit}&parent=${parent}&sortby=${sortby}&search=${search}&startAt=${true}&startAtDate=${startAtDate}&startAtName=${startAtName}&pageToken=${pageToken}`).then((results) => {
|
||||
|
||||
@@ -351,8 +332,6 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star
|
||||
|
||||
} else {
|
||||
|
||||
console.log("is not google")
|
||||
|
||||
axios.get(`/file-service/list?limit=${limit}&parent=${parent}&sortby=${sortby}&search=${search}&startAt=${true}&startAtDate=${startAtDate}&startAtName=${startAtName}`).then((results) => {
|
||||
|
||||
//console.log("load more files result", results.data.length)
|
||||
|
||||
@@ -112,8 +112,6 @@ export const startRemoveFolder = (id, parentList, isGoogle=false, parent, person
|
||||
|
||||
const url = isGoogle ? `/folder-service-google/remove` : personalFolder ? `/folder-service-personal/remove` : `/folder-service/remove`;
|
||||
|
||||
console.log("personal folder", personalFolder);
|
||||
|
||||
axios.delete(url, {
|
||||
data
|
||||
}).then((response) => {
|
||||
|
||||
@@ -25,8 +25,6 @@ export const startSetSelectedItem = (id, file, fromQuickItems, isGoogleDrive) =>
|
||||
|
||||
axios.get(`/file-service-google/info/${id}`).then((results) => {
|
||||
|
||||
console.log("file info google", results.data, results.data.id);
|
||||
|
||||
const data = results.data;
|
||||
|
||||
const {filename: name, length: size, uploadDate: date, parentName: location, metadata, _id: id} = results.data;
|
||||
|
||||
@@ -17,8 +17,6 @@ class DataFormContainer extends React.Component {
|
||||
|
||||
changeListViewMode = () => {
|
||||
|
||||
console.log("changing list view", this.props.listView);
|
||||
|
||||
if (!this.props.listView) {
|
||||
this.props.dispatch(enableListView())
|
||||
} else {
|
||||
@@ -55,10 +53,6 @@ class DataFormContainer extends React.Component {
|
||||
|
||||
loadMoreItems = () => {
|
||||
|
||||
// return;
|
||||
|
||||
console.log("load more items dataform");
|
||||
|
||||
let limit = window.localStorage.getItem("list-size") || 50
|
||||
limit = parseInt(limit)
|
||||
|
||||
|
||||
@@ -52,9 +52,6 @@ class HeaderContainer extends React.Component {
|
||||
const value = e.target.value;
|
||||
this.searchValue = value;
|
||||
|
||||
console.log("search on change", value);
|
||||
|
||||
|
||||
this.props.dispatch(setSearch(value))
|
||||
this.searchSuggested()
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ class HomePageContainer extends React.Component {
|
||||
this.props.dispatch(startResetParentList());
|
||||
|
||||
} else if (pathname.includes("/search")) {
|
||||
console.log("login check set search")
|
||||
this.setSearchItems();
|
||||
return;
|
||||
|
||||
@@ -189,8 +188,6 @@ class HomePageContainer extends React.Component {
|
||||
const storageType = url.searchParams.get("storageType") || undefined;
|
||||
const folderSearch = url.searchParams.get("folder_search") || undefined;
|
||||
|
||||
console.log("Search", value, parent, storageType, folderSearch);
|
||||
|
||||
this.props.dispatch(startResetCache())
|
||||
this.props.dispatch(setCurrentRouteType("search"))
|
||||
this.props.dispatch(setCachedSearch(value))
|
||||
|
||||
@@ -70,8 +70,6 @@ class SettingsPageContainer extends React.Component {
|
||||
env.emailAddress = response.data.email
|
||||
this.props.dispatch(setParent(uuid.v4()))
|
||||
|
||||
console.log("user detailed", response.data)
|
||||
|
||||
this.setState(() => {
|
||||
return {
|
||||
...this.state,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import axios from "axios";
|
||||
|
||||
console.log("Hello, there", process.env.PORT);
|
||||
|
||||
const formElement = document.getElementById("form-submit")
|
||||
const inputElement = document.getElementById("input-password");
|
||||
const mainDiv = document.getElementById("main-div")
|
||||
|
||||
Reference in New Issue
Block a user