Skip to content

Commit 15b8de5

Browse files
[13.x] Fallback to list of auth user providers if no auth guard for Passport is defined (#1840)
* fallback to list of auth user providers for personal access clients * Update ClientCommand.php * fix ci
1 parent 1caca2c commit 15b8de5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Console/ClientCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ protected function createPersonalAccessClient(ClientRepository $clients): ?Clien
7373
{
7474
$provider = $this->option('provider') ?: $this->components->choice(
7575
'Which user provider should this client use to retrieve users?',
76-
collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all(),
76+
collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all()
77+
?: collect(config('auth.providers'))->keys()->all(),
7778
config('auth.guards.api.provider')
7879
);
7980

@@ -89,7 +90,8 @@ protected function createPasswordClient(ClientRepository $clients): Client
8990
{
9091
$provider = $this->option('provider') ?: $this->components->choice(
9192
'Which user provider should this client use to retrieve users?',
92-
collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all(),
93+
collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all()
94+
?: collect(config('auth.providers'))->keys()->all(),
9395
config('auth.guards.api.provider')
9496
);
9597

0 commit comments

Comments
 (0)