fix #18, cache users from fediverse

This commit is contained in:
les
2019-09-12 14:59:51 +02:00
parent fca3b8739d
commit cf5c09e3b1
9 changed files with 158 additions and 34 deletions

View File

@@ -28,10 +28,6 @@ module.exports = (sequelize, DataTypes) => {
is_admin: DataTypes.BOOLEAN,
is_active: DataTypes.BOOLEAN,
rsa: DataTypes.JSON,
followers: {
type: DataTypes.JSON,
defaultValue: []
}
}, {
scopes: {
withoutPassword: {
@@ -43,6 +39,7 @@ module.exports = (sequelize, DataTypes) => {
user.associate = function (models) {
// associations can be defined here
user.hasMany(models.event)
user.belongsToMany(models.fed_users, { through: 'user_followers' })
}
user.prototype.comparePassword = async function (pwd) {