title: Firebase - How to disable user using Cloud Function?
body: <p>I am trying to work out an <em>enable/disable</em> user cloud function. When using the admin SDK to disable the user, I get the response: <em>that the disabled property is read only</em>. Can someone help me out? The data that is passed to the function, is the user ID.</p>
  
  <pre><code> export const disableUser = functions.https.onCall((data, context) =&gt; {
      console.log(data);
  
      admin.auth().updateUser(data, {
          disabled: true
      }).then(() =&gt; {
          admin.firestore().collection('users').doc(data).update({ disabled: true})
              .then(() =&gt;  {
                  console.log(`Successfully disabled user: ${data}`);
  
                  return 200;
              })
              .catch((error =&gt; console.log(error)));        
      }).catch( error =&gt; console.log(error));
  
      return 500;
  });
  </code></pre>