chore: created the route to initate magic link auth

This commit is contained in:
Balu Babu
2023-01-09 17:43:45 +05:30
parent d9e80ebef9
commit 32765b2d34
8 changed files with 63 additions and 13 deletions

View File

@@ -108,3 +108,14 @@ export const taskEitherValidateArraySeq = <A, B>(
TE.getApplicativeTaskValidation(T.ApplicativeSeq, A.getMonoid<A>()),
),
);
/**
* Checks to see if the email is valid or not
* @param email The email
* @returns A Boolean depending on the format of the email
*/
export const validateEmail = (email: string) => {
return new RegExp(
"([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|\"([]!#-[^-~ \t]|(\\[\t -~]))+\")@([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|[[\t -Z^-~]*])",
).test(email);
};