More work on post registration form

This commit is contained in:
Melody Becker 2024-10-28 16:33:17 +01:00
parent 952949b609
commit 8b03454d6f
27 changed files with 247 additions and 51 deletions

View file

@ -1,6 +1,7 @@
import { helper } from '@ember/component/helper';
import { helper } from '@ember/component/helper'
export default helper(function equals(args) {
if (args.length != 2) return false;
return args[0] == args[1];
});
if (args.length != 2) return false
console.log(args[0], args[1])
return args[0] == args[1]
})

View file

@ -0,0 +1,14 @@
import { helper } from '@ember/component/helper';
const re = /.+@\S+\.\S+/;
// Helper to check if a given email is *probably* valid
// Ofc, the only surefire way to check if an email exists is to send a test mail to it.
// This sending is expensive however, and thus some mostly sane defaults can be checked for
// beforehand. "Bananentürkis" for example is obviously not a valid address
export default helper(function isValidMail(positional: string[] /*, named*/) {
for (const mail of positional) {
if (!re.test(mail)) return false;
}
return true;
});