security: prevent leak of creator information in space responses; ensure home folder id is set when creating space

This commit is contained in:
mntmn
2020-05-11 18:28:12 +02:00
committed by mntmn
parent e61bc1e23f
commit effeb6c809
2 changed files with 16 additions and 5 deletions

View File

@@ -51,6 +51,17 @@ module.exports = {
updated_at: {type: Sequelize.DATE, defaultValue: Sequelize.NOW}
}),
CreatorSafeInclude: function(db) {
return {
model: this.User,
as: 'creator',
attributes: ['_id','email','nickname',
'avatar_original_uri',
'avatar_thumb_uri',
'created_at','updated_at']
};
},
Session: sequelize.define('session', {
token: {type: Sequelize.STRING, primaryKey: true},
user_id: Sequelize.STRING,