- More, more, more...

This commit is contained in:
2019-07-04 23:06:04 -04:00
parent 6d5d238d34
commit af13551042
16 changed files with 348 additions and 94 deletions

View File

@@ -26,17 +26,55 @@ module.exports = function (server, auth) {
if (info) {
res.send(200, {
registrationSuccess: false,
success: false,
nextSteps: 'Please fix the problems indicated and try again.'
...info
});
return next();
}
res.send(200, {
registrationSuccess: true,
success: true,
nextSteps: 'Check your email for our confirmation email, you will not be able to login without confirming.'
})
});
next();
});
});
server.post('/signup/verify/resend', (req, res, next) => {
const { body: { email = null } = {} } = req;
User.resendVerificationEmail(email, (err, user, info) => {
if (err) {
next(err);
}
if (!user) {
res.send(200, {
success: false,
nextSteps: 'There was no user located with the email address provided. Please try again.',
});
return next();
}
if (user && info.success) {
res.send(200, {
success: true,
nextSteps: 'Check your email for our confirmation email, you will not be able to login without confirming.',
});
return next();
}
res.send(200, {
success: false,
nextSteps: 'There was a problem resending the verification email. Please try again later.',
});
next();
});
});
};