Browse Source

fix: deactivated users can still refresh their token (#2105)

pull/2109/head
Regev Brody 4 years ago
committed by GitHub
parent
commit
6ef7b0f130
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions
  1. 4
      server/models/users.js

4
server/models/users.js

@ -337,6 +337,10 @@ module.exports = class User extends Model {
WIKI.logger.warn(`Failed to refresh token for user ${user}: Not found.`)
throw new WIKI.Error.AuthGenericError()
}
if (!user.isActive) {
WIKI.logger.warn(`Failed to refresh token for user ${user}: Inactive.`)
throw new WIKI.Error.AuthAccountBanned()
}
} else if (_.isNil(user.groups)) {
user.groups = await user.$relatedQuery('groups').select('groups.id', 'permissions')
}

Loading…
Cancel
Save