title: firestore security rule request.auth.uid is not working
body: <p>Firestore security rules do not work.
  Help me.
  Document data of users/userid could not be read.</p>
  
  <p>----------Security Rule------------</p>
  
  <pre><code>service cloud.firestore {
   match /databases/{database}/documents {
    match /users/{userId=**} {
  
    // Missing or insufficient permissions.
      allow read, write: if request.auth.uid == userId
  
    // this is work.
    //allow read, write: if request.auth != null
  
  }
  </code></pre>
  
  <p>}
  }</p>
  
  <p>--------------main.js--------------------</p>
  
  <pre><code>import Vue from 'vue'
  import Quasar from 'quasar'
  import firebase from 'firebase'
  import 'firebase/firestore'
  
  Vue.config.productionTip = false
  Vue.use(Quasar)
  
  
  let app;
  firebase.initializeApp({
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: ""
  })
  
  
  firebase.auth().onAuthStateChanged(user=&gt; {
    if (user) {
      let ref = firebase.firestore().collection('users').doc(user.uid)
      ref.get().then(snapshot=&gt;{
        // Error !! : Missing or insufficient permissions.
      }
    }
    if(!app){
      Quasar.start(() =&gt; {
        app = new Vue({
          el: '#q-app',
          render: h =&gt; h(require('./App').default)
        })
      })
    }
  
  })
  </code></pre>
  
  <p>firebase ^4.8.0
  vue ^2.5.0</p>
  
  <p>Apparently, require.auth.uid does not seem to work properly.
  Where is there a mistake in me?</p>