add github linking enforcement
This commit is contained in:
@ -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 (
|
||||||
|
Reference in New Issue
Block a user