add github linking enforcement

This commit is contained in:
Quincy Larson
2015-10-05 22:42:42 -07:00
parent 188da02ffc
commit 9a0505f782

View File

@ -274,23 +274,32 @@ module.exports = function(app) {
}); });
return res.redirect('/'); return res.redirect('/');
} }
if (!user.isGithubCool) {
req.flash('errors', {
msg: dedent`
This user needs to link GitHub with their account
in order to display this certificate to the public.
`
});
return res.redirect('back');
}
if (user.isLocked) { if (user.isLocked) {
req.flash('errors', { req.flash('errors', {
msg: dedent` msg: dedent`
Looks like user '${username}'s account is locked ${username} has chosen to hide their work from the public.
down to the public. They need to unhide their work in order for this certificate to
be verifiable.
` `
}); });
return res.redirect('/'); return res.redirect('back');
} }
if (!user.isHonest) { if (!user.isHonest) {
req.flash('errors', { req.flash('errors', {
msg: dedent` msg: dedent`
Looks like the user '${username}'s has not signed ${username} has not agreed to our Academic Honesty Pledge yet.
the academic honesty pledge.
` `
}); });
return res.redirect('/'); return res.redirect('back');
} }
if ( if (