laravel / passport

Laravel Passport provides OAuth2 server support to Laravel.
https://laravel.com/docs/passport
MIT License
3.29k stars 780 forks source link

passport:install breaking change #1784

Closed sajadshouli closed 2 months ago

sajadshouli commented 2 months ago

Passport Version

12

Laravel Version

11

PHP Version

8.2

Database Driver & Version

No response

Description

the passport package version 12 made a breaking change by replacing the passport:install to passport:keys and passport:client

these changes are fine for me but I have a problem in my testing area since I use orchestra/testbench package for package development

in my setUp function in the test class

I make passport keys to test some features like authentication like this

            // Artisan::call('passport:install');
            Artisan::call('passport:keys');
            Artisan::call('passport:client --personal --name=test');
            Passport::tokensCan([
                'is-test'       => 'token belongs to test',
                'is-user'       => 'token belongs to an user',
            ]);

in the new version of Laravel or passport you must publish the migrations(in the old version it was not necessary) so for the first time when I run the test it throw an exception that the oauth tables do not exist so I have to run passport:install to publish tables for the first time

image

and I have to comment on the passport:install command since for the second time my tests run it throws the oauth table already exists since the orchestra or passport publish it again with other names

Screenshot 2024-09-05 200918

And I do not know if to report this bug on orchestra/testbench repo or if it is a problem with passport since the orchestra is a wrapper of Laravel framework

@crynobone

Steps To Reproduce

make a test

hafezdivandari commented 2 months ago

Duplicate of #1729 and #1781

driesvints commented 2 months ago

Please see the above. Thanks @hafezdivandari