title: How to store hashed passwords in firestore
body: <p>so i want to save a user object in firestore, it's my first time working with firestore, so i use Bcrypt to encode the password than i save the object in firestore but it doesn't seem to be able to save it </p>
  
  <p><strong>This is my code</strong></p>
  
  <pre><code> * createUser
   * @param {string} email
   * @param {string} password
   * @param {string} name
   */
  const createUser = async (email, password, name) =&gt; {
    const user = await getUser(email);
    if (user) throw new Error('User account already exists');
  
    bcrypt.genSalt(10, (salt) =&gt; {
      bcrypt.hash(password, salt, (hashedPassword) =&gt; {
        db.collection('users')
          .doc(email)
          .set({ hashedPassword, email, name });
      });
    });
  };
  </code></pre>
  
  <p>and am getting this error</p>
  
  <pre><code>        throw new Error(validate_1.customObjectMessage(arg, value, path));
          ^
  
  Error: Value for argument "data" is not a valid Firestore document. Input is not a plain JavaScript object (found in field "hashedPassword").
      at Object.validateUserInput (/home/abdessalem/Desktop/tutum/test/simple-auth-app/node_modules/@google-cloud/firestore/build/src/serializer.js:301:15)
      at validateDocumentData (/home/abdessalem/Desktop/tutum/test/simple-auth-app/node_modules/@google-cloud/firestore/build/src/write-batch.js:620:22)
      at WriteBatch.set (/home/abdessalem/Desktop/tutum/test/simple-auth-app/node_modules/@google-cloud/firestore/build/src/write-batch.js:234:9)
      at DocumentReference.set (/home/abdessalem/Desktop/tutum/test/simple-auth-app/node_modules/@google-cloud/firestore/build/src/reference.js:340:14)
      at /home/abdessalem/Desktop/tutum/test/simple-auth-app/src/firestore/index.js:54:10
      at /home/abdessalem/Desktop/tutum/test/simple-auth-app/node_modules/bcrypt/bcrypt.js:140:13
      at processTicksAndRejections (internal/process/task_queues.js:79:11)
  </code></pre>