Back

account.create phone and password values are not updated to the console after signup[Solved]

  • 0
  • Users
  • Accounts
  • Web
Krownwealth_dev
23 Nov, 2023, 08:18

I'm using appwrite for the first time. And I tried to sigunup user, I tested the form by signing up, and checked my appwrite console. Only the email and name values returned, the phone and password value that I filled in didn't appear in the console.

Here's is my code that handles the call

const handleSignUpSubmit = async (e) => { e.preventDefault(); try { const { email, password, phone, name } = userDetails; const newUser = await account.create( ID.unique(), email, password, name, phone ); if (newUser) { console.log("User signed up successfully:", newUser); } else { console.log("Error signing up user:", newUser); } } catch (error) { console.error("Error signing up user:", error); } };

Below is the response I got from appwrite when I console.log the data been submitted.

User signed up successfully: { "$id": "655f0950d6ae1b22f830", "$createdAt": "2023-11-23T08:12:00.964+00:00", "$updatedAt": "2023-11-23T08:12:00.964+00:00", "name": "Adeola Joseph", "registration": "2023-11-23T08:12:00.879+00:00", "status": true, "labels": [], "passwordUpdate": "2023-11-23T08:12:00.879+00:00", "email": "joseph@gmail.com", "phone": "", "emailVerification": false, "phoneVerification": false, "prefs": {}, "accessedAt": "2023-11-23T08:12:00.879+00:00" }

TL;DR
The user is experiencing an issue where the `phone` and `password` values are not being updated in the console after signing up using the appwrite platform. The user has confirmed that only the `email` and `name` values are being returned in the console. The user has provided their code for handling the signup and the response they received from appwrite. Solution: It seems that the `createUser()` function in appwrite only accepts four parameters - `UserID`, `email`, `password`, and `name`. To set the `phone number`, the user needs to call the `account.updatePhone()` function after creating the account
Krownwealth_dev
23 Nov, 2023, 08:19

account.create phone and password values are not updated to the console after successful signup

ideclon
23 Nov, 2023, 21:57

That’s correct. There are only four parameters for createUser() - UserID, email, password, name.

If you want to set the phone number, you can call `account.updatePhone()’ after creating the account.

ideclon
23 Nov, 2023, 21:58

You’re not able to see a user’s password, but it will have been set!

Krownwealth_dev
24 Nov, 2023, 14:05

Ok

Krownwealth_dev
24 Nov, 2023, 14:05

Thank you

ideclon
26 Nov, 2023, 06:23

Np! If your issue has been solved, you can close this post by adding “[SOLVED]” to the beginning of the title

Krownwealth_dev
26 Nov, 2023, 06:45

account.create phone and password values are not updated to the console after signup[Solved]

ideclon
26 Nov, 2023, 06:45

To the beginning of the title 😉

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more