fix: Prevent registration spamming
This commit is contained in:
parent
c25536f09a
commit
3834590c5a
@ -119,6 +119,19 @@ const password = encodeURIComponent(env["LATEINICUS_USER_PW"]);
|
|||||||
|
|
||||||
const { username, password, classId } = req.body;
|
const { username, password, classId } = req.body;
|
||||||
|
|
||||||
|
// Check if the registration is open for the class Id
|
||||||
|
// NOTE: Thiis to prevent people from spamming the database
|
||||||
|
const classes = env["LATEINICUS_CLASSES"].split(",");
|
||||||
|
if (classes.indexOf(classId) !== -1) {
|
||||||
|
res.send({
|
||||||
|
error: "403",
|
||||||
|
data: {
|
||||||
|
msg: "Class does not exist",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Check if the username is profane
|
// TODO: Check if the username is profane
|
||||||
// if (profanityFilter.isProfane(username)) {
|
// if (profanityFilter.isProfane(username)) {
|
||||||
// res.send({
|
// res.send({
|
||||||
|
Reference in New Issue
Block a user