Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

create custom objects for user in 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 :: footer credits with jquery date time 
Typescript :: typescript axios 
Typescript :: how can i add multiple arguments in discord,js 
Typescript :: how to check if key exists in Newtonsoft.Json object c# 
Typescript :: typescript trim spaces in string array 
Typescript :: what are the common mistakes in testing 
Typescript :: --skip tests generate components - Angular 12 - skip-tests vs spec-false 
Typescript :: find unique values between 2 lists R 
Typescript :: admin_enqueue_scripts specific page 
Typescript :: how push objects into a local stotage array 
Typescript :: remove upsell products woocommerce 
Typescript :: Text input detect return key react native 
Typescript :: counts of unique values in rows of given 2D array numpy 
Typescript :: typescript check type 
Typescript :: typescript convert readonly 
Typescript :: npm typescript package 
Typescript :: python discord action when someone reacts to message 
Typescript :: serenity.is hide form field 
Typescript :: get typescript props of component 
Typescript :: create and use constants in angularjs 
Typescript :: angular cancel http request 
Typescript :: mat card api 
Typescript :: async http requests python - Aiohttp 
Typescript :: padding entre les elements css 
Typescript :: typescript interface to http params 
Typescript :: swift check if file exists in bundle swift 
Typescript :: ts object field from variable 
Typescript :: typescript class inheritance 
Typescript :: how to show code conflicts in git 
Typescript :: fetch tweets 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =