Skip to content

Commit 2a830dd

Browse files
authored
Limit username length (#1769)
* This prevents some flooding * Can tweak this a little bit but we'll see * Checked with `db.users.find({$where:'this.name.length > 65'}).pretty();` Auto-merge
1 parent 132efb6 commit 2a830dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

controllers/auth.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ exports.auth = function (aReq, aRes, aNext) {
150150
return;
151151
}
152152

153+
if (username.length > 64) {
154+
aRes.redirect('/login?toolong');
155+
return;
156+
}
157+
153158
// Store the username in the session so we still have it when they
154159
// get back from authentication
155160
if (!aReq.session.username) {

0 commit comments

Comments
 (0)