Added terms of service checkbox validation
parent
b76e67d3a4
commit
11296bccd4
|
@ -79,7 +79,14 @@ exports.getSignup = function(req, res) {
|
|||
*/
|
||||
exports.postSignup = function(req, res) {
|
||||
|
||||
console.log(req.body.tos);
|
||||
// TODO: add mongoose validation on ToS (virtual?)
|
||||
// TODO: Mongoose virtual, move logic to model
|
||||
|
||||
if (!req.body.tos) {
|
||||
req.flash('messages', 'You must agree to terms and conditions');
|
||||
return res.redirect('/signup');
|
||||
}
|
||||
if (req.body.password !== req.body.confirmPassword) {
|
||||
req.flash('messages', 'Passwords do not match');
|
||||
return res.redirect('/signup');
|
||||
|
|
|
@ -22,7 +22,7 @@ block content
|
|||
input.form-control(type='password', name='confirmPassword', id='confirmPassword', placeholder='Confirm Password')
|
||||
.help-block
|
||||
label.checkbox
|
||||
input(type='checkbox')
|
||||
input(type='checkbox', id='tos', name='tos')
|
||||
| I agree to
|
||||
a(href='#terms-conditions', data-toggle='modal') terms and conditions
|
||||
.form-group
|
||||
|
|
Loading…
Reference in New Issue