title: Nuxt.js auth module does not redirect logged in user
body: <p>Authenticated user can still access the <code>/login</code> page. If I follow a link to <code>/login</code> page, I am redirected to a different page, which works fine. But if I enter <code>/login</code> into URL manually, I am still being taken to <code>/login</code> page, even though I am already logged in. What I am trying to achieve is, when the user is logged in, they should be redirected to <code>/retailer/account</code> page before any components are shown on the page (if they enter <code>/login</code> page manually).</p>
  <p>I was trying using <code>beforeMount()</code> function, <code>beforeCreate()</code> function, following the <a href="https://auth.nuxtjs.org/guide/middleware.html" rel="nofollow noreferrer">documentation</a> for <code>auth: 'guest'</code> middleware, however it does not seem to have any effect and <code>loggedIn</code> always returns <code>false</code> before the page is fully rendered.</p>
  <p>My setup:</p>
  <p><code>nuxt.config.js</code> :</p>
  <pre><code>export default {
    mode: 'universal',
    target: 'static',
    auth: {
      cookie: {
        prefix: 'auth_'
      },
      // Options
      redirect: {
        login: '/login',
        logout: '/login',
        callback: false,
        home: '/retailer/account'
      },
      strategies: {
        local: {
          endpoints: {
            login: {
              url: '/auth/login',
              method: 'post',
              propertyName: 'access_token',
              credentials: true
            },
            logout: {
              url: '/auth/logout',
              method: 'post'
            },
            user: {
              url: '/auth/me',
              method: 'post',
              propertyName: '',
              credentials: false
            }
          },
          token: {
            required: true,
            type: 'Bearer',
            global: true
          },
          autoFetchUser: true
        }
      },
      preserveState: true,
      watchLoggedIn: true
    },
    router: {
      middleware: [
        'auth'
      ]
    }
  }
  </code></pre>
  <p><code>layouts/default.vue</code> :</p>
  <pre><code>export default {
    auth: false
  }
  
  </code></pre>
  <p><code>pages/retailer/account.vue</code> :</p>
  <pre><code>export default {
    middleware: 'auth'
  }
  </code></pre>
  <p><code>pages/login.vue</code> :</p>
  <pre><code>export default {
    middleware: 'authenticated',
    auth: 'guest'
  }
  </code></pre>
  <p>Tried all kinds of middleware examples I could find and made some simple redirection code, but, as mentioned before, <code>app.$auth.loggedIn</code> always returns <code>false</code> from server-side, so I never get redirected.</p>
  <p><code>middleware/authenticated.js</code></p>
  <pre><code>export default function ({ app, redirect }) {
    if (app.$auth.loggedIn) {
      return redirect(app.localePath({ name: 'index' }))
    }
  }
  </code></pre>
  <p>Later, when Vue hydrates the app, <code>loggedIn</code> is, of course, <code>true</code>.</p>
  <p>Any ideas what I am doing wrong? Any guidance would be a huge help!</p>