title: ADONISJS Separate auth for admin and user models
body: <p>I have this code for creating separate auth for admin and user models - it seems to be working HOWEVER, i can't get the template to show the correct menus if admin is logged in or not.</p>
  <p>Here is the code for separate auth - working fine:</p>
  <pre><code>//Inside your config/auth.js, you can create multiple authenticators for admin and user.
  {
      user: {
          serializer: 'lucid',
          model: 'App/Models/User',
          scheme: 'session',
          uid: 'email',
          password: 'password'
      },
      admin: {
          serializer: 'lucid',
          model: 'App/Models/Admin',
          scheme: 'session',
          uid: 'email',
          password: 'password'
      }
  }
  </code></pre>
  <p>Here is the code in my template - NOT working:</p>
  <pre><code>@loggedIn
   &lt;a href=&quot;logout&quot;&gt;Log out&lt;/a&gt;
   @else
   &lt;a href=&quot;login&quot;&gt;Log in&lt;/a&gt;
   &lt;a href=&quot;register&quot;&gt;Register&lt;/a&gt;
   @endloggedIn
  </code></pre>
  <p>I also tried this but Not Working:</p>
  <pre><code>&lt;ul class=&quot;sidenav&quot; id=&quot;mobile-demo&quot;&gt;
      @if(auth.user)
      &lt;li&gt;&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;/logout&quot;&gt;Logout&lt;/a&gt;&lt;/li&gt;
      @elseif(auth.admin)
      &lt;li&gt;&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;/logout&quot;&gt;Logout&lt;/a&gt;&lt;/li&gt;
      @else
      &lt;li&gt;&lt;a href=&quot;/login_index&quot;&gt;Login&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;register_index&quot;&gt;Register&lt;/a&gt;&lt;/li&gt;
      @endif
  &lt;/ul&gt;
  </code></pre>