mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
feat: banned-users group
This commit is contained in:
@@ -200,7 +200,10 @@ usersAPI.ban = async function (caller, data) {
|
||||
until: data.until > 0 ? data.until : undefined,
|
||||
reason: data.reason || undefined,
|
||||
});
|
||||
await user.auth.revokeAllSessions(data.uid);
|
||||
const canLoginIfBanned = await user.bans.canLoginIfBanned(data.uid);
|
||||
if (!canLoginIfBanned) {
|
||||
await user.auth.revokeAllSessions(data.uid);
|
||||
}
|
||||
};
|
||||
|
||||
usersAPI.unban = async function (caller, data) {
|
||||
@@ -209,6 +212,9 @@ usersAPI.unban = async function (caller, data) {
|
||||
}
|
||||
|
||||
await user.bans.unban(data.uid);
|
||||
|
||||
sockets.in('uid_' + data.uid).emit('event:unbanned');
|
||||
|
||||
await events.log({
|
||||
type: 'user-unban',
|
||||
uid: caller.uid,
|
||||
|
||||
Reference in New Issue
Block a user