title: Firebase Auth returning undefined for createUserWithEmailAndPassword
body: <p>I have a function that creates a new user through Firebase Auth, and for awhile I had it working but now it's returning undefined. I tried using async await to wait for an input with no help, and I'm not really sure what could be going wrong. I can't include my Firebase auth code on here, but I put the rest of the code on CodePen:</p>
  <p><a href="https://codepen.io/TheNomadicAspie/pen/ZEKYwWJ" rel="nofollow noreferrer">https://codepen.io/TheNomadicAspie/pen/ZEKYwWJ</a></p>
  <p>And here are the relevant function:</p>
  <pre><code>function newUserSubmitEmail() {
      traceFunction()
      new_user_dict['email'] = input_text.value.trim()
      console.log('newUserSubmitEmail email is ', new_user_dict['email'])
      question.innerText = &quot;What password would you like to use?&quot;
      input_text.value = ''
      right_button.onclick = newUserSubmitPassword
  }
  
  function newUserSubmitPassword() {
      traceFunction()
      new_user_dict['password'] = input_text.value.trim()
      console.log('newUserSubmitPassword password is ', new_user_dict['password'])
      question.innerText = &quot;Ok, and enter it one more time just to make sure there's no typos.&quot;
      input_text.value = ''
      right_button.onclick = newUserVerifyPassword
  }
  
  function newUserVerifyPassword() {
      traceFunction()
      if (new_user_dict['password'] === input_text.value) {
          newUserSubmitEmailAndPassword()
      } else {
          question.innerText = &quot;Those passwords didn't match. Let's try again.&quot;
          console.log('newUserVerifyPassword old password was ', new_user_dict['password'], ' new password is ', input_text.value)
          input_text.value = ''
          right_button.onclick = newUserSubmitPassword
      }
  }
  
  async function newUserSubmitEmailAndPassword() {
      traceFunction()
      console.log('newUserSubmitEmailAndPassword email is ', new_user_dict['email'], ' password is ', new_user_dict['password'])
      input_text.value = ''
      firebase.auth().createUserWithEmailAndPassword(await new_user_dict['email'], await new_user_dict['password']).then((userCredential) =&gt; {
              console.log('newUserSubmitEmailAndPassword User created successfully')
              userCreatedSuccessfully()
          })
          .catch(async (error) =&gt; {
              var errorCode = await error.code
              var errorMessage = error.message
              question.innerText = errorCode
              console.log('newUserSubmitEmailAndPassword Error creating user. Error code: ', errorCode, ' ', errorMessage)
              if (errorCode === 'auth/email-already-in-use') {
                  newUserEmailInUse()
              } else if (errorCode === 'auth/invalid-email') {
                  newUserTryEmailAgain()
              } else if (errorCode === 'auth/operation-not-allowed') {
                  errorPleaseRefresh()
              } else if (errorCode === 'auth/weak-password') {
                  newUserTryPasswordAgain()
              }
          })
  }
  </code></pre>
  <p>Any ideas?</p>