Unverified Commit 6ef7b0f1 authored by Regev Brody's avatar Regev Brody Committed by GitHub

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

parent 4bc284b0
......@@ -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')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment