Added creation of 'dummy emails' for all newly created accounts...
This commit is contained in:
parent
26636d5f2f
commit
fabb2ca606
|
@ -42,7 +42,7 @@ AUTH.post('/register', async (req, res) => {
|
|||
delete valid[captcha]
|
||||
|
||||
// Does the username match the requirements?
|
||||
if (!(/^(?=[a-zA-Z0-9]{2,20}$).*$/.test(username)))
|
||||
if (!(/^\w{2,20}$/.test(username)))
|
||||
return(res.send("Username does not match the requirements"))
|
||||
|
||||
if ((await glauth.query("SELECT * FROM users WHERE name = $1::text", [ username ])).rowCount)
|
||||
|
@ -52,8 +52,8 @@ AUTH.post('/register', async (req, res) => {
|
|||
hash => {
|
||||
const hexHash = hash2hex(hash)
|
||||
glauth.query(
|
||||
"INSERT INTO users(name, primarygroup, passbcrypt, qam_pass) VALUES($1::text, 0, $2::text, $3::text)",
|
||||
[ username, hexHash, hash ]
|
||||
"INSERT INTO users(name, mail, primarygroup, passbcrypt, qam_pass) VALUES($1::text, $2::text, 0, $3::text, $4::text)",
|
||||
[ username, `${username}@qwik.space`, hexHash, hash ]
|
||||
).then(
|
||||
() => res.send("Account registered!")
|
||||
).catch(
|
||||
|
|
Loading…
Reference in New Issue
Block a user