#[SOLVED] LOG [AppwriteException: Invalid email: Value must be a valid email address]
50 messages · Page 1 of 1 (latest)
Email is empty
yeah i am taking inputs from user
Don't trigger it until the user clicks the send button and the variable is set with a valid email
this
Yes, you're passing the value to the function, but it's being triggered probably every frame while your app runs. Is that what's causing the prior rate limiting in your app?
yes you are right
You should then create a separate function and trigger it only when the button is being clicked
I can't make calls, but I will be here for everything you need
ohh its okay
what changes i should make to solve this error
Invalid email: Value must be a valid email address
Your app workflow should be like that:
Button clicked-> variables set with the fields value-> data sent to appwrite
Alternative:
Variables changed every time the field changes (what you're currently making)-> button clicked-> send data to your appetite instance
So you will need in order to trigger with the button a separate function whe has your appwrite code
i did like this
const handleSignup = async () => {
const emailRegex = /^[^\s@]+@[^\s@]+.[^\s@]+$/;
if (!emailRegex.test(user.email)) {
console.log('Invalid email address:', user.email);
// Handle the error or display an error message to the user
} else {
// The email address is valid, proceed with the account creation
try {
const result = await account.create(
uuidv4(),
user.name,
user.email,
user.password,
);
console.log('User created:', result);
Alert.alert('Success', 'User created successfully.');
} catch (error) {
if (error.code === 429) {
// Rate limit exceeded, wait for some time before retrying
const waitTime =
error.response.headers['x-ratelimit-reset'] * 1000 - Date.now();
console.log(
Rate limit exceeded. Waiting for ${waitTime} milliseconds before retrying.,
);
await new Promise(resolve => setTimeout(resolve, waitTime));
handleSignup(); // Retry the signup process
} else {
console.log('Error creating user:', error);
Alert.alert('Error', 'Failed to create user.');
}
}
}
console.log('User name:', user.name);
console.log('User email:', user.email);
console.log('User password:', user.password);
};
output
Are you triggering this when the button is clicked or every time the field changes?
Seems like you're not setting things in the correct order
It's:
UserID
Email
Password
Name
Try placing them in such order
ohh okay
Tell me if that solves the issue
please reply
Seeing
kk
Are you sure everything is placed in the correct order?
Not only email, everything, like I've specified
I think you have the user name, as the password
the order is this right..
{"$createdAt": "2023-05-20T04:59:55.195+00:00", "$id": "2e01e8d9-e77b-49ab-93e2-b44351aac5bc", "$updatedAt": "2023-05-20T04:59:55.195+00:00", "email": "[email protected]", "emailVerification": false, "name": "Walter o'Brian", "passwordUpdate": "2023-05-20T04:59:55.194+00:00", "phone": "", "phoneVerification": false, "prefs": {}, "registration": "2023-05-20T04:59:55.194+00:00", "status": true}
even if i give different values for name and password it's giving same error
And if you use 10 characters with 1 letter and symbol?
Maybe you're not meeting the password policy set
Make console.log(user.password) inside the account.create function
And send what the console shows
thank you D5
you told me the correct sequence and order but i mistakenly did unordered
that was my mistake
🙂
Oh, perfect then, I thought there was any conflict with something else