title: JWT Auth config on Dingo Api Laravel 5.1.*
body: <p>I am using Laravel 5.1.33 with Dingo Api and JWT Auth, have installed all of these but now I am confused if I need to do more if I for example want to authenticate a user so the user is not able to access certain routes without being logged in first.</p>
  
  <p>I havethis code modified on api.php:</p>
  
  <pre><code>    'auth' =&gt; [
      'jwt' =&gt; 'Dingo\Api\Auth\Provider\JWT',
  ],
  </code></pre>
  
  <p>I am confused when it comes here, where to add this code and what does it really do?</p>
  
  <pre><code>app('Dingo\Api\Auth\Auth')-&gt;extend('jwt', function ($app) {
     return new Dingo\Api\Auth\Provider\JWT($app['Tymon\JWTAuth\JWTAuth']);
  });
  </code></pre>
  
  <p>I have read dingo/api has in-built support for tymondesigns/jwt-auth, does this mean I dont need to write any authentication code, or what does this mean? </p>
  
  <p>Could anyone tell me if I have to modify the current AuthController which at this moment looks as below:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Auth;
  
  use App\User;
  use Validator;
  use App\Http\Controllers\Controller;
  use Illuminate\Foundation\Auth\ThrottlesLogins;
  use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
  
  class AuthController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Registration &amp; Login Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles the registration of new users, as well as the
      | authentication of existing users. By default, this controller uses
      | a simple trait to add these behaviors. Why don't you explore it?
      |
      */
  
      use AuthenticatesAndRegistersUsers, ThrottlesLogins;
  
      /**
       * Create a new authentication controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest', ['except' =&gt; 'getLogout']);
      }
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'name' =&gt; 'required|max:255',
              'email' =&gt; 'required|email|max:255|unique:users',
              'password' =&gt; 'required|confirmed|min:6',
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return User
       */
      protected function create(array $data)
      {
          return User::create([
              'name' =&gt; $data['name'],
              'email' =&gt; $data['email'],
              'password' =&gt; bcrypt($data['password']),
          ]);
      }
  }
  </code></pre>
  
  <p>If so, what methods needs to be added?
  It says that Dingo supports in built jwt auth, therefor i decided to use this packages, not only this reasons as well as few other reasons, like transformers,rate limit etc... but I am still confused whether I need to write extra code for Authentication users as it already supports in build... If not, how do I login? I have no routes declared for authentications,nor register users, I should somehow point those routes to some controllers, anyone could help with this?</p>