Sfoglia il codice sorgente

refactor: Excludes user credentials by default

Owen Diffey 4 settimane fa
parent
commit
d6bf01329a
1 ha cambiato i file con 13 aggiunte e 1 eliminazioni
  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, {