title: VUE - FIREBASE | How to get the user profile from the realtime database
body: <p>I got the user profile from the Realtime database but when I have more than 1 account I get the second user profile too.</p>
  
  <p>Here below you see the data from 2 users. But I want to get the user that is loggend in and that is the  <strong>currentUser</strong></p>
  
  <p>The ID is the <strong>currentUser</strong></p>
  
  <p><a href="https://i.stack.imgur.com/x2ltr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x2ltr.png" alt="enter image description here"></a></p>
  
  <p>This is the Realtime database:</p>
  
  <p><a href="https://i.stack.imgur.com/QuwNv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QuwNv.png" alt="enter image description here"></a></p>
  
  <p>This is my <strong>Profile.vue page</strong>:</p>
  
  <pre><code>          &lt;div class="container" v-for="profileData of profile" :key="profileData['.key']"&gt;
              &lt;div v-if="seen" class="row"&gt;
                &lt;div class="col"&gt;
                  &lt;div class="card card-border" style="width: 30rem;"&gt;
                    &lt;div class="card-body"&gt;
                      &lt;h4 class="card-title text-center mb-4"&gt;Personal information&lt;/h4&gt;
                        &lt;p class="card-text"&gt;ID: {{profileData.CurrentUser}}&lt;/p&gt;
                        &lt;p class="card-text"&gt;First name: {{profileData.firstName}}&lt;/p&gt;
                        &lt;p class="card-text"&gt;Last name: {{profileData.lastName}}&lt;/p&gt;
                        &lt;p class="card-text"&gt;Phone number: {{profileData.phoneNumber}}&lt;/p&gt;
                        &lt;p class="card-text"&gt;Adress: {{profileData.adress}}&lt;/p&gt;
                        &lt;p class="card-text"&gt;Citizenship: {{profileData.citizenship}}&lt;/p&gt;
                        &lt;p class="card-text"&gt;Personal email: {{profileData.personalEmail}}&lt;/p&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="col"&gt;&lt;/div&gt;
                &lt;div class="col"&gt;
                  &lt;div class="card card-border" style="width: 30rem;"&gt;
                    &lt;div class="card-body"&gt;
                      &lt;h4 class="card-title text-center mb-3"&gt;Business information&lt;/h4&gt;
                        &lt;p&gt;Company name: {{profileData.companyName}}&lt;/p&gt;
                        &lt;p&gt;Chamber Of Commerce Number: {{profileData.chamberOfCommerceNumber}}&lt;/p&gt;
                        &lt;p&gt;Street: {{profileData.street}}&lt;/p&gt;
                        &lt;p&gt;House number: {{profileData.houseNumber}}&lt;/p&gt;
                        &lt;p&gt;ZIP code: {{profileData.zipCode}}&lt;/p&gt;
                        &lt;p&gt;Location: {{profileData.location}}&lt;/p&gt;
                        &lt;p&gt;Company email: {{profileData.companyEmail}}&lt;/p&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
  </code></pre>
  
  <p>I added a if/else in the <strong>created()</strong> section below.</p>
  
  <p>And this is the script:</p>
  
  <pre><code>&lt;script&gt;
  import firebase from "firebase";
  import { db } from '../../config/db';
  
  export default {
    data() {
      return {
        email: "",
        password: "",
        profileData: [],
        isHidden: true,
        seen: true,
        isLoggedIn: false
      }
    },
    firebase: {
      profile: db.ref('profile')
    },
    methods: {
      resetPassword() {
        const auth = firebase.auth();
        auth.sendPasswordResetEmail(auth.currentUser.email).then(() =&gt; {
          console.log('Email send');
          // Email sent.
        }).catch((error) =&gt; {
          // An error happened.
          console.log(error);
        });
      }
    },
    created() {
      if(firebase.auth().currentUser) {
        this.isLoggedIn = true;
        this.currentUser = firebase.auth().currentUser.email;
      }
      var user = firebase.auth().currentUser;
      if (this.user == this.profileData.CurrentUser) {
        this.seen = true;
      } else {
        this.seen = false;
      }
    }
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>In this Profile.vue page I have the <strong>add function</strong>:</p>
  
  <pre><code>AddProfile() {
              console.log(JSON.stringify(this.profileData) + this.currentUser)
              this.$firebaseRefs.profile.push({
                  firstName: this.profileData.firstName,
                  lastName: this.profileData.lastName,
                  phoneNumber: this.profileData.phoneNumber,
                  adress: this.profileData.adress,
                  citizenship: this.profileData.citizenship,
                  personalEmail: this.profileData.personalEmail,
                  companyName: this.profileData.companyName,
                  chamberOfCommerceNumber: this.profileData.chamberOfCommerceNumber,
                  street: this.profileData.street,
                  houseNumber: this.profileData.houseNumber,
                  zipCode: this.profileData.zipCode,
                  location: this.profileData.location,
                  companyEmail: this.profileData.companyEmail,
                  CurrentUser: this.currentUser
              })
              this.profileData.firstName = '';
              this.profileData.lastName = '';
              this.profileData.phoneNumber = '';
              this.profileData.adress = '';
              this.profileData.personalEmail = '';
              this.profileData.companyName = '';
              this.profileData.chamberOfCommerceNumber = '';
              this.profileData.street = '';
              this.profileData.houseNumber = '';
              this.profileData.zipCode = '';
              this.profileData.location = '';
              this.profileData.companyEmail = '';
              this.CurrentUser = '';
              window.scrollTo(0,0, 0,0);
              console.log('Added to database');
              /* Waiting for 2 seconds here */
              this.$router.push('/internship')
          },
  </code></pre>