Removed redundant express-validator validations, notEmpty()
This commit is contained in:
@ -23,7 +23,6 @@ exports.getLogin = function(req, res) {
|
||||
*/
|
||||
|
||||
exports.postLogin = function(req, res, next) {
|
||||
req.assert('email', 'Email cannot be blank').notEmpty();
|
||||
req.assert('email', 'Email is not valid').isEmail();
|
||||
req.assert('password', 'Password cannot be blank').notEmpty();
|
||||
|
||||
@ -69,9 +68,7 @@ exports.getSignup = function(req, res) {
|
||||
*/
|
||||
|
||||
exports.postSignup = function(req, res, next) {
|
||||
req.assert('email', 'Email cannot be blank').notEmpty();
|
||||
req.assert('email', 'Email is not valid').isEmail();
|
||||
req.assert('password', 'Password cannot be blank').notEmpty();
|
||||
req.assert('password', 'Password must be at least 4 characters long').len(4);
|
||||
req.assert('confirmPassword', 'Passwords do not match').equals(req.body.password);
|
||||
|
||||
@ -141,7 +138,6 @@ exports.postUpdateProfile = function(req, res, next) {
|
||||
*/
|
||||
|
||||
exports.postUpdatePassword = function(req, res, next) {
|
||||
req.assert('password', 'Password cannot be blank').notEmpty();
|
||||
req.assert('password', 'Password must be at least 4 characters long').len(4);
|
||||
req.assert('confirmPassword', 'Passwords do not match').equals(req.body.password);
|
||||
|
||||
|
Reference in New Issue
Block a user