fix: Invalid portal domain validation (#6166)

* fix: Invalid portal domain validation


Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Sivin Varghese
2023-01-09 13:42:19 +05:30
committed by GitHub
parent 4172cb4b23
commit 0a65a233d7
3 changed files with 23 additions and 2 deletions

View File

@@ -17,3 +17,7 @@ export const isValidPassword = value => {
);
};
export const isNumber = value => /^\d+$/.test(value);
export const isDomain = value => {
const domainRegex = /^([\p{L}0-9]+(-[\p{L}0-9]+)*\.)+[a-z]{2,}$/gmu;
return domainRegex.test(value);
};