Jwt-auth: Class jwt does not exist

Created on 18 Feb 2019  路  7Comments  路  Source: tymondesigns/jwt-auth

Subject of the issue

Your environment

| Q | A
| ----------------- | ---

| Framework | Laravel
| Framework version | 5.5.*
| Package version | 1.0.0-rc.1
| PHP version | 7.1

jwt

Most helpful comment

@chaucachavez

I fixed, making this change

AuthController.php

old

public function __construct()
{
$this->middleware('jwt', ['except' => ['login']]);
}

new

public function __construct()
{
$this->middleware('auth:api', ['except' => ['login']]);
}

All 7 comments

hey, did you solved this issue @varichs ?

hey, did you solved this issue @varichs ?

yes, I just used the wrong middleware name

@varichs I have the same error, can you specify how you solved it? please

@chaucachavez

I fixed, making this change

AuthController.php

old

public function __construct()
{
$this->middleware('jwt', ['except' => ['login']]);
}

new

public function __construct()
{
$this->middleware('auth:api', ['except' => ['login']]);
}

Thanks a lot @alexarros ! :clap: It worked for me.

it works thanks!

in case someone finds this because of the error "Target class [auth.jwt] does not exist.": don麓t forget to add:

protected $routeMiddleware = [
   'auth.jwt'         => Authenticate::class,
];
Was this page helpful?
0 / 5 - 0 ratings