title: How to call mixin function in middleware
body: <p>How can I call mixin function in middleware with NUXT.js?</p>
  
  <p>I am trying to do this:</p>
  
  <pre><code>export default function(context) {
    // init auth token from the local store or cookies
    context.initAuth(context.req)
  
    if (!context.store.getters['sessionStorage/isAuthenticated']) {
      context.redirect("/login")
    }
  }
  </code></pre>
  
  <p>where <code>initAuth()</code> function is located in the <code>plugins/auth.js</code> mixin file</p>