瀏覽代碼

fix: Users getData block fetching certain properties

Owen Diffey 3 年之前
父節點
當前提交
a79a9633b7
共有 2 個文件被更改,包括 30 次插入7 次删除
  1. 23 0
      backend/logic/actions/users.js
  2. 7 7
      frontend/src/pages/Admin/tabs/Punishments.vue

+ 23 - 0
backend/logic/actions/users.js

@@ -205,6 +205,29 @@ export default {
 
 		async.waterfall(
 			[
+				next => {
+					const invalidProperties = [...properties, ...queries.map(query => query.filter.property)].find(
+						property => {
+							if (
+								[
+									"services.password",
+									"services.password.password",
+									"services.password.reset.code",
+									"services.password.reset.expires",
+									"services.password.set.code",
+									"services.password.set.expires",
+									"services.github.access_token",
+									"services.email.verificationToken"
+								].includes(property)
+							)
+								return true;
+							return false;
+						}
+					);
+					if (invalidProperties) next("Invalid paramaters given.");
+					else next();
+				},
+
 				next => {
 					userModel.find(queryObject).count((err, count) => {
 						next(err, count);

+ 7 - 7
frontend/src/pages/Admin/tabs/Punishments.vue

@@ -187,13 +187,13 @@ export default {
 				}
 			],
 			filters: [
-				{
-					name: "status",
-					displayName: "Status",
-					property: "status",
-					filterTypes: ["contains", "exact", "regex"],
-					defaultFilterType: "contains"
-				},
+				// {
+				// 	name: "status",
+				// 	displayName: "Status",
+				// 	property: "status",
+				// 	filterTypes: ["contains", "exact", "regex"],
+				// 	defaultFilterType: "contains"
+				// },
 				{
 					name: "type",
 					displayName: "Type",