Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passport install prompt #1729

Closed
Tahiaji opened this issue Mar 14, 2024 · 5 comments
Closed

Passport install prompt #1729

Tahiaji opened this issue Mar 14, 2024 · 5 comments
Assignees

Comments

@Tahiaji
Copy link

Tahiaji commented Mar 14, 2024

Passport Version

12.0.0

Laravel Version

11.0.5

PHP Version

8.2

Database Driver & Version

8.0

Description

After updating the package, the command passport:install now has two prompts for user input.

image

This command is used in deployments and tests and there is no possibility of a manual response. This change is not mentioned in the upgrade guide.

How can I now execute this command without user interaction?

Steps To Reproduce

php artisan passport:install
@Tahiaji
Copy link
Author

Tahiaji commented Mar 14, 2024

Example case of usage in tests https://stackoverflow.com/a/50243105/1202097

@nunomaduro
Copy link
Member

The passport:install command was not meant to be run multiple times. Meaning, it should not be part of a deployment process or run before tests.

Typically, that command should run only once per project locally (because it publishes migrations, etc). This change, of adding prompts to this install command is not mentioned in the upgrade guide because that command only serves 'fresh' new Laravel applications.

@Tahiaji
Copy link
Author

Tahiaji commented Mar 14, 2024

Even if such behavior was not intended - there are many places where it can be used without user interaction.

And even if this is expected behavior, the change in the operating logic is extremely significant and it would be nice to at least mention it in the change history

@MarcEspiard
Copy link

Hey, just thought I'd mention that this also broke my tests during the upgrade from 10 to 11.
It would be nice to at least mention it in the upgrade guide or the changelog.

Fixed it by publishing the passport migrations and replacing the passport:install call in my test seeder by:

Artisan::call('passport:keys');
Artisan::call('passport:client', ['--personal' => true, '--name' => config('app.name') . ' Personal Access Client']);
$provider = in_array('users', array_keys(config('auth.providers'))) ? 'users' : null;
Artisan::call('passport:client', ['--password' => true, '--name' => config('app.name') . ' Password Grant Client', '--provider' => $provider]);

@RaylsonCavalcante
Copy link

@MarcEspiard
Obrigado. Funcionou!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants