File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -55,21 +55,23 @@ public function handle(Config $config) : void
5555
5656 $ gphoto = new GPhoto ($ this ->argument ('name ' ));
5757
58+ $ url = $ gphoto ->oauth ()->buildFullAuthorizationUri ([
59+ 'access_type ' => 'offline ' ,
60+ ]);
61+
62+ $ this ->components ->info ('Auth URL : ' . $ url );
63+
5864 // open auth url in browser
5965 foreach (['xdg-open ' , 'sensible-browser ' , 'start ' ] as $ command ) {
60- $ process = Process::run (sprintf ('%s "%s" ' , $ command , $ gphoto ->oauth ()->buildFullAuthorizationUri ([
61- 'access_type ' => 'offline ' ,
62- ])));
66+ $ process = Process::run (sprintf ('%s "%s" ' , $ command , $ url ));
6367
6468 if ($ process ->successful ()) {
6569 break ;
6670 }
6771 }
6872
6973 $ listener = new TokenListener ($ gphoto );
70- $ listener ->listen (
71- $ this ->components
72- );
74+ $ listener ->listen ($ this ->components );
7375 }
7476
7577 /**
Original file line number Diff line number Diff line change @@ -47,21 +47,23 @@ public function handle() : void
4747 return ;
4848 }
4949
50+ $ url = $ gphoto ->oauth ()->buildFullAuthorizationUri ([
51+ 'access_type ' => 'offline ' ,
52+ ]);
53+
54+ $ this ->components ->info ('Auth URL : ' . $ url );
55+
5056 // open auth url in browser
5157 foreach (['xdg-open ' , 'sensible-browser ' , 'start ' ] as $ command ) {
52- $ process = Process::run (sprintf ('%s "%s" ' , $ command , $ gphoto ->oauth ()->buildFullAuthorizationUri ([
53- 'access_type ' => 'offline ' ,
54- ])));
58+ $ process = Process::run (sprintf ('%s "%s" ' , $ command , $ url ));
5559
5660 if ($ process ->successful ()) {
5761 break ;
5862 }
5963 }
6064
6165 $ listener = new TokenListener ($ gphoto );
62- $ listener ->listen (
63- $ this ->components
64- );
66+ $ listener ->listen ($ this ->components );
6567 }
6668
6769 /**
You can’t perform that action at this time.
0 commit comments