title: how to disable middleware in specific page, nuxt middleware
body: <h2>i have declare a middleware that check role of every routes in nuxt.config.js. but want to disable in some pages.</h2>
  <pre><code>// in nuxt.config.js =&gt;        
          router: {
              middleware: ['role']
            },
          
          
          
   // in middleware/role.js =&gt;     
          export default function ({app}) {
            if (!window.localStorage.getItem('auth.token')) {    
              //app.router.push('/auth/login');   
              console.log('middleware');
            }
          }
          
          
   // in login.vue =&gt;     
              export default {
                  role: false,
                }
      
      
   // in root page =&gt;
          export default { 
            role: false,               
            middleware({app}){
              if (!window.localStorage.getItem('auth.token')) {
                app.router.push('/auth/login');
              }
            },    
        }
  </code></pre>
  <p>when token is empty and redirect user, the page is loading again and again so i comment this redirect and console log a message, to check what happen.
  this role middleware is loading on that page where the role middleware is set to false.
  check the image below.</p>
  <p><a href="https://i.stack.imgur.com/idKyO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/idKyO.png" alt="image of browser console" /></a></p>
  <p>here you can see middleware printed twice, one for root('/') and another one for login page (here i disabled role middleware). how to disable this middleware to this login page.</p>