Skip to content
Snippets Groups Projects
Commit f9b4f59a authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Ensure LiU mails are rejected

parent 0d7ca493
No related branches found
No related tags found
No related merge requests found
...@@ -106,8 +106,7 @@ export default { ...@@ -106,8 +106,7 @@ export default {
if (!this.user.email || !this.user.email.includes('@') || !this.user.email.includes('.')) { if (!this.user.email || !this.user.email.includes('@') || !this.user.email.includes('.')) {
this.errors.email = "Specify a valid email address"; this.errors.email = "Specify a valid email address";
} }
else if (this.user.email.endsWith('@liu.se')) else if (this.user.email.match(/@(.+\.)?liu\.se$/)) {
{
this.errors.email = "LiU users should use their LiU-ID to sign in"; this.errors.email = "LiU users should use their LiU-ID to sign in";
} }
......
...@@ -55,6 +55,10 @@ router.post('/', async (req, res) => { ...@@ -55,6 +55,10 @@ router.post('/', async (req, res) => {
} }
} }
if (req.body.email.match(/@(.*\.)?liu\.se$/)) {
return res.status(400).send({ 'message': 'LiU users should use their LiU-ID to sign in here' })
}
// TODO: Apply further validation on input // TODO: Apply further validation on input
// XXX Make sure user is allowed to create // XXX Make sure user is allowed to create
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment