title: Nuxt auth user reset after browser refresh
body: <p>i'm building an app with user login and register info. I use nuxt/auth module for handling the authentification.  Whenever the user get logs in the state changes to true without a problem. The only issue i'm having is when i call set user method , the user info get registered successfully, but whenever i refresh the browser i lose the user data even though in the first place it was set successfully.</p>
  <p>my nuxt.js config for nuxt auth module</p>
  <pre><code>auth: {
          strategies: {
            local: {
              token: {
                property: &quot;token&quot;,
                global: true,
              },
              redirect: {
                  &quot;login&quot;: &quot;/account/login&quot;,
                  &quot;logout&quot;: &quot;/&quot;,
                  &quot;home&quot;: &quot;/page/ajouter-produit&quot;,
                  &quot;callback&quot;: false
              },
              endpoints: {
                login: { url: &quot;http://localhost:5000/login&quot;, method: &quot;post&quot; },
                logout: false, //  we don't have an endpoint for our logout in our API and we just remove the token from localstorage
                user:false
              }
            }
          }
        },
  </code></pre>
  <p>My register/login component</p>
  <pre><code>        async typeForm(e) {
              this.typesubmit = true;
              // stop here if form is invalid
              this.$v.$touch();
              if (this.$v.typeform.$anyError) {
                  return;
              }
              const user = await axios.post(`${baseUrl}register`,{
                  username:this.typeform.username,
                  password:this.typeform.password,
                  email:this.typeform.email,
                  tel:this.typeform.tel,
                  adresse:this.typeform.adresse,
                  store:this.typeform.store,
              })
              .then(response =&gt; {
                  console.log(response.data)
                  return response.data.user;
              }).catch( (error) =&gt; {
                  this.error = ''
                  this.error = error.response.data
              })
  
              if(user){
                  let loginData = {email:this.typeform.email,  password:this.typeform.password} 
                  const response = await this.$auth.loginWith('local', { data: loginData})
                  .then(response =&gt; {
                  this.$auth.setUser(response.data.user) // the user is set without a problem, everything works fine.
                  return response.data;
                  }).catch( (error) =&gt; {
                      this.errors = error.response.data
                      console.log(error.response)
                  })
              }
              
          }
  </code></pre>
  <p>When i console log the state and the user in the first place everything works fine</p>
  <pre><code>  console.log(this.$store.state.auth.user) // logs all user data i get from the api call. but when i refresh i get an empty object 
    console.log(this.$store.state.auth.loggedIn) // logs true , and even after i refresh it's still true
  </code></pre>
  <p>please help</p>