Skip to content

Commit 25bccf4

Browse files
authored
Fix username character limit (#2113)
* chore: add 32 character limit for username * chore: fix failing test
1 parent 6c33d2a commit 25bccf4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

middlewares/validators/user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const updateUser = async (req, res, next) => {
2121
.string()
2222
.optional()
2323
.min(4)
24-
.max(20)
24+
.max(32)
2525
.regex(/^[a-zA-Z0-9-]+$/)
26-
.message("Username must be between 4 and 20 characters long and contain only letters or numbers."),
26+
.message("Username must be between 4 and 32 characters long and contain only letters or numbers."),
2727
first_name: joi.string().optional(),
2828
last_name: joi.string().optional(),
2929
yoe: joi.number().min(0).optional(),

test/integration/users.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ describe("Users", function () {
363363
expect(res.body).to.eql({
364364
statusCode: 400,
365365
error: "Bad Request",
366-
message: "Username must be between 4 and 20 characters long and contain only letters or numbers.",
366+
message: "Username must be between 4 and 32 characters long and contain only letters or numbers.",
367367
});
368368

369369
return done();

0 commit comments

Comments
 (0)