Browse Source

refactor: Excludes user credentials by default

Owen Diffey 4 weeks ago
parent
commit
d6bf01329a
1 changed files with 13 additions and 1 deletions
  1. 13 1
      backend/src/modules/DataModule/models/User.ts

+ 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, {