unsoft's avatar

Removing Passport, error given

I'm attempting to remove Passport from my application. Here are the steps I've followed so far:

  1. composer remove laravel/passport && composer update
  2. Removed \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class from app/Http/Kernel.php
  3. Removed use Laravel\Passport\Passport; and Passport::routes(); from the boot() of app/Providers/AuthServiceProvider.php
  4. Removed use Laravel\Passport\HasApiTokens; and use HasApiTokens from app/User.php
  5. Changed ['api']['driver'] to token in config/auth.php
  6. Deleted public/js/app.js, resources/assets/js/components/passport, and removed passport references from resources/assets/js/app.js
  7. php artisan cache:clear

I must have missed something somewhere, because I'm given the error

InvalidArgumentException: Auth driver [passport] for guard [api] is not defined.

If the full stack is required for debugging this issue, here it is (paste.laravel.io).

0 likes
2 replies
Cronix's avatar

Have you tried artisan config:clear? also try composer dumpautoload

unsoft's avatar
unsoft
OP
Best Answer
Level 1

@Cronix I haven't tried that yet, no.

I have no idea if this is correct, but I changed:

Route::middleware('auth:api')->group(function () {

to

Route::middleware('auth')->group(function () {

Is this acceptable? Using PostMan, I don't appear to be able to access any restricted content unless I'm logged in.

Please or to participate in this conversation.