- More, more, more...
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user