mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-31 10:07:28 +01:00
adding email validator (#178)
This commit is contained in:
@@ -77,6 +77,15 @@
|
||||
|
||||
async function registerUser() {
|
||||
loading.value = true;
|
||||
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
|
||||
if (!emailRegex.test(email.value)) {
|
||||
toast.error("Invalid email address");
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const { error } = await api.register({
|
||||
name: username.value,
|
||||
email: email.value,
|
||||
|
||||
Reference in New Issue
Block a user