Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/routes/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
const USER_RE = /^.{1,20}$/;
const FNAME_RE = /^.{1,100}$/;
const LNAME_RE = /^.{1,100}$/;
const EMAIL_RE = /^[\S]+@[\S]+\.[\S]+$/;

Check warning on line 128 in app/routes/session.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of the unused 'EMAIL_RE' variable.

See more on https://sonarcloud.io/project/issues?id=VandelaySecurity_NodeGoat&issues=AZ9V4AD30_vsReWVZCtr&open=AZ9V4AD30_vsReWVZCtr&pullRequest=113

Check warning on line 128 in app/routes/session.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless assignment to variable "EMAIL_RE".

See more on https://sonarcloud.io/project/issues?id=VandelaySecurity_NodeGoat&issues=AZ9V4AD30_vsReWVZCts&open=AZ9V4AD30_vsReWVZCts&pullRequest=113
const PASS_RE = /^.{1,20}$/;
/*
//Fix for A2-2 - Broken Authentication - requires stronger password
Expand Down Expand Up @@ -163,7 +163,7 @@
return false;
}
if (email !== "") {
if (!EMAIL_RE.test(email)) {
if (!validator.isEmail(email)) {
errors.emailError = "Invalid email address";
return false;
}
Expand Down Expand Up @@ -193,7 +193,6 @@
}

userDAO.addUser(userName, firstName, lastName, password, email, (err, user) => {

if (err) return next(err);

//prepare data for the user
Expand Down
Loading