Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

create custom user properties firebase

everytime user is signing up, create a firestore doc about that user 

async function signUp(email, password) {
  // This function returns a credential which gives you the user's uid
  // which you could then use to create your document
  const credential = await createUserWithEmailAndPassword(auth, email, password);

  const uid = credential.user.uid

  // Create a new document using the uid as the document id
  // or however else you want to use this
  const ref = firebase.auth().collection("users").doc(uid)
  await ref.set({
    email,
    uid
  })
}

CODE BY "I'm Joe Too" from StackOverflow https://stackoverflow.com/questions/69547341/creating-a-document-every-time-someone-signs-up-in-firebase
Comment

PREVIOUS NEXT
Code Example
Typescript :: activate jquery in typescript 
Typescript :: ts singleton pattern 
Typescript :: Duplicate function implementation.ts(2393) 
Typescript :: dotnet cli sln add all projects 
Typescript :: eslint typescript vite not showing lint on code 
Typescript :: node js process on unhandled promise rejection 
Typescript :: NFS is reporting that your exports file is invalid. Vagrant does this check before making any changes to the file. Please correct the issues below and execute "vagrant reload": 
Typescript :: what are google extensions 
Typescript :: python sort list according to two elements in tuple 
Typescript :: absolute path react native 
Typescript :: redux persist typescript 
Typescript :: python convert long floats to usd 
Typescript :: how to auto collect channel points twitch 
Typescript :: write a script that prints hello world followed by a new line to the standard output in linux 
Typescript :: angle between two vectors 
Typescript :: typescript value in enum 
Typescript :: How to add new row to a particular index of a ag grid using angular 7 
Typescript :: react google charts x labels multiline 
Typescript :: react-native use typescript 
Typescript :: angular animation done event type typescript 
Typescript :: command line arguments in java 
Typescript :: Warning: call_user_func_array() expects parameter 1 to be a valid callback 
Typescript :: ract import image 
Typescript :: update object in array in ngxrx store in angular 
Typescript :: any typescript 
Typescript :: invoke lambda after cdk deploy 
Typescript :: typescript assert non null 
Typescript :: props tsx 
Typescript :: unknown type in typescript 
Typescript :: java login attempts using for loop 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =