Removed redundant express-validator validations, notEmpty()
parent
27d9c9b0f6
commit
246b51a793
|
@ -260,6 +260,7 @@ exports.getTwitter = function(req, res, next) {
|
||||||
* GET /api/paypal
|
* GET /api/paypal
|
||||||
* PayPal SDK example
|
* PayPal SDK example
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.getPayPal = function(req, res, next) {
|
exports.getPayPal = function(req, res, next) {
|
||||||
paypal.configure(secrets.paypal);
|
paypal.configure(secrets.paypal);
|
||||||
var payment_details = {
|
var payment_details = {
|
||||||
|
@ -300,6 +301,7 @@ exports.getPayPal = function(req, res, next) {
|
||||||
* GET /api/paypal/success
|
* GET /api/paypal/success
|
||||||
* PayPal SDK example
|
* PayPal SDK example
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.getPayPalSuccess = function(req, res, next) {
|
exports.getPayPalSuccess = function(req, res, next) {
|
||||||
var payment_id = req.session.payment_id;
|
var payment_id = req.session.payment_id;
|
||||||
var payment_details = { 'payer_id': req.query.PayerID };
|
var payment_details = { 'payer_id': req.query.PayerID };
|
||||||
|
@ -322,6 +324,7 @@ exports.getPayPalSuccess = function(req, res, next) {
|
||||||
* GET /api/paypal/cancel
|
* GET /api/paypal/cancel
|
||||||
* PayPal SDK example
|
* PayPal SDK example
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.getPayPalCancel = function(req, res, next) {
|
exports.getPayPalCancel = function(req, res, next) {
|
||||||
req.session.payment_id = null;
|
req.session.payment_id = null;
|
||||||
res.render('api/paypal', {
|
res.render('api/paypal', {
|
||||||
|
|
|
@ -23,7 +23,6 @@ exports.getLogin = function(req, res) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.postLogin = function(req, res, next) {
|
exports.postLogin = function(req, res, next) {
|
||||||
req.assert('email', 'Email cannot be blank').notEmpty();
|
|
||||||
req.assert('email', 'Email is not valid').isEmail();
|
req.assert('email', 'Email is not valid').isEmail();
|
||||||
req.assert('password', 'Password cannot be blank').notEmpty();
|
req.assert('password', 'Password cannot be blank').notEmpty();
|
||||||
|
|
||||||
|
@ -69,9 +68,7 @@ exports.getSignup = function(req, res) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.postSignup = function(req, res, next) {
|
exports.postSignup = function(req, res, next) {
|
||||||
req.assert('email', 'Email cannot be blank').notEmpty();
|
|
||||||
req.assert('email', 'Email is not valid').isEmail();
|
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('password', 'Password must be at least 4 characters long').len(4);
|
||||||
req.assert('confirmPassword', 'Passwords do not match').equals(req.body.password);
|
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) {
|
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('password', 'Password must be at least 4 characters long').len(4);
|
||||||
req.assert('confirmPassword', 'Passwords do not match').equals(req.body.password);
|
req.assert('confirmPassword', 'Passwords do not match').equals(req.body.password);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue