| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 22 | 
| Code Lines | 11 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 17 | public function issueToken(PasswordGrantProxyControllerRequest $request) | ||
| 18 |     { | ||
| 19 | $http = new Client(); | ||
| 20 | |||
| 21 |         $client = DB::table('oauth_clients')->where('id', 2)->first(); | ||
| 22 | |||
| 23 | // dump($request->username); | ||
| 24 | // dump($request->password); | ||
| 25 | // dump($client->redirect); | ||
| 26 | |||
| 27 |         $response = $http->post(url('http://tasks.test/oauth/token'), [ | ||
| 28 | 'form_params' => [ | ||
| 29 | 'grant_type' => 'password', | ||
| 30 | 'client_id' => $client->id, | ||
| 31 | 'client_secret' => $client->secret, | ||
| 32 | 'username' => $request->username, | ||
| 33 | 'password' => $request->password, | ||
| 34 | 'scope' => '', | ||
| 35 | ], | ||
| 36 | ]); | ||
| 37 | |||
| 38 | return json_decode((string) $response->getBody(), true); | ||
| 39 | } | ||
| 41 |