Skip to content

Commit

Permalink
Merge pull request #296 from labzero/develop
Browse files Browse the repository at this point in the history
Merge to master
  • Loading branch information
JeffreyATW authored Apr 28, 2023
2 parents 1a7c753 + 993690a commit 20d4463
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/middlewares/invitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ Add them here: ${generateUrl(req, bsHost, `/users/new?email=${querystring.escape
const { email } = req.body;

try {
if (!email) {
req.flash('error', 'Email is required.');
return req.session.save(() => {
res.redirect('/invitation/new');
});
}

const existingInvitation = await Invitation.findOne({ where: { email } });

if (existingInvitation) {
Expand Down

0 comments on commit 20d4463

Please sign in to comment.