ability to ban and unban users
This commit is contained in:
@@ -219,6 +219,14 @@ router.post(
|
||||
});
|
||||
}
|
||||
|
||||
// Check if user is banned
|
||||
if (user.isBanned) {
|
||||
return res.status(403).json({
|
||||
error: "Your account has been suspended. Please contact support for more information.",
|
||||
code: "USER_BANNED",
|
||||
});
|
||||
}
|
||||
|
||||
// Verify password
|
||||
const isPasswordValid = await user.comparePassword(password);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user