You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user tries to sign up, you are not checking if they are signed up already.
You could do this by querying the database first to check if the user already exists.
Eg:
databaseConnection.query(` SELECT CASE WHEN EXISTS(SELECT email FROM users WHERE email = $1) THEN CAST (true AS BOOLEAN) ELSE CAST (false AS BOOLEAN) END`,[email],(err,res)=>{constdoesUserAlreadyExist=res.rows[0].caseif(err)cb(err);elsecb(null,doesUserAlreadyExist);});
This is nice because the query will give you a boolean, which you can use to decide whether the user is signed up already.
The text was updated successfully, but these errors were encountered:
When a user tries to sign up, you are not checking if they are signed up already.
You could do this by querying the database first to check if the user already exists.
Eg:
This is nice because the query will give you a boolean, which you can use to decide whether the user is signed up already.
The text was updated successfully, but these errors were encountered: