Skip to content

Commit 30feae0

Browse files
Correct adding new users handle (#4055)
If user has already existed, response error should be 400.
1 parent 0f5c187 commit 30feae0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

locale/en/docs/guides/simple-profiling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ app.get('/newUser', (req, res) => {
3737

3838
username = username.replace(/[!@#$%^&*]/g, '');
3939

40-
if (!username || !password || !users[username]) {
40+
if (!username || !password || users[username]) {
4141
return res.sendStatus(400);
4242
}
4343

@@ -59,7 +59,7 @@ app.get('/auth', (req, res) => {
5959

6060
username = username.replace(/[!@#$%^&*]/g, '');
6161

62-
if (!username || !password || !users[username]) {
62+
if (!username || !password || users[username]) {
6363
return res.sendStatus(400);
6464
}
6565

0 commit comments

Comments
 (0)