Back

[SOLVED] Get Username using Email Id

  • 0
  • Web
Hmm
30 Mar, 2023, 15:13

Is there any way to get the username after auth with email Id . Currently I am handling the sign up like this

TypeScript
  async function handleSignUp(data) {
    try {
      const response = await account.create(
        ID.unique(),
        data.email,
        data.password
      );
      console.log(response);
      // success
      setUser((prev) => ({ ...prev, ...data }));
    } catch (error) {
      console.log(error); // Failure
    }
  }

I am not prompting for username in UI , so I am not passing it

TL;DR
The user is asking how to retrieve the username after authentication using an email ID. The response suggests using user preferences or creating a profiles collection to store and make the username public to other users. The code provided is for handling sign up and does not include a prompt for the username in the UI. No direct solution is given in the thread.
joeyouss
30 Mar, 2023, 15:52

Hi, so Appwrite doesnt have concept of usernames. You can use user preferences to store any kind of data on the user (key/value pairs) Or you could have profiles collection to make this username public to other users

joeyouss
24 Apr, 2023, 08:48

[SOLVED] Get Username using Email Id

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