Prechádzať zdrojové kódy

refactor: Excludes user credentials by default

Owen Diffey 4 týždňov pred
rodič
commit
d6bf01329a

+ 13 - 1
backend/src/modules/DataModule/models/User.ts

@@ -293,7 +293,19 @@ export const schema = {
 	}
 };
 
-export const options = {};
+export const options = {
+	defaultScope: {
+		attributes: {
+			exclude: [
+				"emailVerificationToken",
+				"password",
+				"passwordResetCode",
+				"passwordSetCode",
+				"githubAccessToken"
+			]
+		}
+	}
+};
 
 export const setup = async () => {
 	User.hasMany(Session, {