mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-15 09:27:31 +01:00
security: prevent leak of creator information in space responses; ensure home folder id is set when creating space
This commit is contained in:
11
models/db.js
11
models/db.js
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user