Skip to content

Commit

Permalink
Added redirect_uri and user_id options to cli
Browse files Browse the repository at this point in the history
When using `passport:client` commands, add `redirect_uri` and `user_id` options. Useful for automated builds.
  • Loading branch information
matthewsuan authored Jan 3, 2019
1 parent d7f24f6 commit ea8639c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Console/ClientCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class ClientCommand extends Command
{--personal : Create a personal access token client}
{--password : Create a password grant client}
{--client : Create a client credentials grant client}
{--redirect_uri= : Redirect URI after authorization request }
{--user_id= : User ID the client is assigned to }
{--name= : The name of the client}';

/**
Expand Down Expand Up @@ -118,15 +120,15 @@ protected function createClientCredentialsClient(ClientRepository $clients)
*/
protected function createAuthCodeClient(ClientRepository $clients)
{
$userId = $this->ask(
$userId = $this->option('user_id') ?: $this->ask(
'Which user ID should the client be assigned to?'
);

$name = $this->option('name') ?: $this->ask(
'What should we name the client?'
);

$redirect = $this->ask(
$redirect = $this->option('redirect_uri') ?: $this->ask(
'Where should we redirect the request after authorization?',
url('/auth/callback')
);
Expand Down

0 comments on commit ea8639c

Please sign in to comment.