| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| 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 | $client = DB::table('oauth_clients')->where('id', 2)->first(); |
||
| 21 | // dump($request->username); |
||
| 22 | // dump($request->password); |
||
| 23 | // dump($client->redirect); |
||
| 24 | $response = $http->post(url('http://tasks.test/oauth/token'), [ |
||
| 25 | 'form_params' => [ |
||
| 26 | 'grant_type' => 'password', |
||
| 27 | 'client_id' => $client->id, |
||
| 28 | 'client_secret' => $client->secret, |
||
| 29 | 'username' => $request->username, |
||
| 30 | 'password' => $request->password, |
||
| 31 | 'scope' => '', |
||
| 32 | ], |
||
| 33 | ]); |
||
| 34 | |||
| 35 | return json_decode((string) $response->getBody(), true); |
||
| 36 | } |
||
| 38 |